diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 282adee5e7..91dc192d77 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -947,6 +947,8 @@ class HostSerializer(BaseSerializerWithVariables): except (ValueError, TypeError): try: vars_dict = yaml.safe_load(variables) + if vars_dict is None: + vars_dict = {} vars_dict['ansible_ssh_port'] = port attrs['variables'] = yaml.dump(vars_dict) except (yaml.YAMLError, TypeError):