update tests to new Ansible core code

This commit is contained in:
AlanCoding
2017-10-26 08:00:49 -04:00
parent 565d116955
commit e5d2eb9f3d

View File

@@ -28,9 +28,9 @@ with mock.patch.dict(os.environ, {'ANSIBLE_STDOUT_CALLBACK': CALLBACK,
'ANSIBLE_CALLBACK_PLUGINS': PLUGINS}): 'ANSIBLE_CALLBACK_PLUGINS': PLUGINS}):
from ansible.cli.playbook import PlaybookCLI from ansible.cli.playbook import PlaybookCLI
from ansible.executor.playbook_executor import PlaybookExecutor 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.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 # Add awx/lib to sys.path so we can use the plugin
path = os.path.abspath(os.path.join(PLUGINS, '..', '..')) path = os.path.abspath(os.path.join(PLUGINS, '..', '..'))
@@ -67,9 +67,8 @@ def executor(tmpdir_factory, request):
cli.parse() cli.parse()
options = cli.parser.parse_args(['-v'])[0] options = cli.parser.parse_args(['-v'])[0]
loader = DataLoader() loader = DataLoader()
variable_manager = VariableManager() variable_manager = VariableManager(loader=loader)
inventory = Inventory(loader=loader, variable_manager=variable_manager, inventory = InventoryManager(loader=loader, sources='localhost,')
host_list=['localhost'])
variable_manager.set_inventory(inventory) variable_manager.set_inventory(inventory)
return PlaybookExecutor(playbooks=playbook_files, inventory=inventory, return PlaybookExecutor(playbooks=playbook_files, inventory=inventory,