From 6269b43456ff6cc2d135baa5076c80b9bd3a465e Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Thu, 26 Oct 2017 08:00:49 -0400 Subject: [PATCH] update tests to new Ansible core code --- awx/lib/tests/test_display_callback.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/awx/lib/tests/test_display_callback.py b/awx/lib/tests/test_display_callback.py index 1607544827..fefd5d4188 100644 --- a/awx/lib/tests/test_display_callback.py +++ b/awx/lib/tests/test_display_callback.py @@ -23,9 +23,9 @@ with mock.patch.dict(os.environ, {'ANSIBLE_STDOUT_CALLBACK': CALLBACK, 'ANSIBLE_CALLBACK_PLUGINS': PLUGINS}): from ansible.cli.playbook import PlaybookCLI from ansible.executor.playbook_executor import PlaybookExecutor - from ansible.inventory import Inventory + from ansible.inventory.manager import InventoryManager from ansible.parsing.dataloader import DataLoader - from ansible.vars import VariableManager + from ansible.vars.manager import VariableManager # Add awx/lib to sys.path so we can use the plugin path = os.path.abspath(os.path.join(PLUGINS, '..', '..')) @@ -62,9 +62,8 @@ def executor(tmpdir_factory, request): cli.parse() options = cli.parser.parse_args(['-v'])[0] loader = DataLoader() - variable_manager = VariableManager() - inventory = Inventory(loader=loader, variable_manager=variable_manager, - host_list=['localhost']) + variable_manager = VariableManager(loader=loader) + inventory = InventoryManager(loader=loader, sources='localhost,') variable_manager.set_inventory(inventory) return PlaybookExecutor(playbooks=playbook_files, inventory=inventory,