refactor inventory Loaders for ansible-inventory

* remove support for loading from executable and static files
* instead use ansible-inventory with fallback to backport
* provide private file dir in task manager for cred injection
* durable management of tmp dirs for user scripts

* new 'scm' source choice for scm-type
* update SCM inventory docs to new reality
This commit is contained in:
AlanCoding
2017-04-26 14:40:36 -04:00
parent a92c7cec7d
commit 2f62182940
8 changed files with 177 additions and 173 deletions

View File

@@ -117,7 +117,7 @@ class TestInvalidOptionsFunctional:
@mock.patch.object(inventory_import.Command, 'set_logging_level', mock_logging)
class TestINIImports:
@mock.patch.object(inventory_import.BaseLoader, 'load', mock.MagicMock(return_value=TEST_MEM_OBJECTS))
@mock.patch.object(inventory_import.AnsibleInventoryLoader, 'load', mock.MagicMock(return_value=TEST_MEM_OBJECTS))
def test_inventory_single_ini_import(self, inventory, capsys):
cmd = inventory_import.Command()
r = cmd.handle_noargs(

View File

@@ -12,7 +12,8 @@ class TestSCMUpdateFeatures:
inv_src = InventorySource(
scm_project=project,
source_path='inventory_file',
inventory=inventory)
inventory=inventory,
source='scm')
with mock.patch.object(inv_src.scm_project, 'update') as mck_update:
inv_src.save()
mck_update.assert_called_once_with()