mirror of
https://github.com/ansible/awx.git
synced 2026-02-20 20:50:06 -03:30
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user