mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Fix an issue where passing an empty yaml file (or ---) would cause an
error if including a port specifier on a hostname
This commit is contained in:
parent
58b3f4360c
commit
f5391cab11
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user