diff --git a/broker/providers/ansible_tower.py b/broker/providers/ansible_tower.py index 6684a2e..1251ff3 100644 --- a/broker/providers/ansible_tower.py +++ b/broker/providers/ansible_tower.py @@ -10,7 +10,7 @@ from logzero import logger from broker import exceptions -from broker.helpers import eval_filter, find_origin +from broker.helpers import eval_filter, find_origin, yaml from broker.settings import settings try: @@ -21,6 +21,12 @@ from broker import helpers from broker.providers import Provider +# ruamel has a hard time with PseudoNamespace objects +yaml.representer.add_representer( + awxkit.utils.PseudoNamespace, + lambda dumper, data: dumper.represent_dict(dict(data)), +) + def convert_pseudonamespaces(attr_dict): """Recursively convert PsuedoNamespace objects into dictionaries."""