Reinstate external inventory script support this time using the new more OO-ey inventory system.

Next up: YAML format.
This commit is contained in:
Michael DeHaan 2012-05-06 14:47:05 -04:00
commit 256377166a
2 changed files with 28 additions and 6 deletions

View file

@ -108,7 +108,6 @@ class TestInventory(unittest.TestCase):
### Inventory API tests
def test_script(self):
raise SkipTest
inventory = self.script_inventory()
hosts = inventory.list_hosts()
@ -119,7 +118,6 @@ class TestInventory(unittest.TestCase):
assert sorted(hosts) == sorted(expected_hosts)
def test_script_all(self):
raise SkipTest
inventory = self.script_inventory()
hosts = inventory.list_hosts('all')
@ -127,7 +125,6 @@ class TestInventory(unittest.TestCase):
assert sorted(hosts) == sorted(expected_hosts)
def test_script_norse(self):
raise SkipTest
inventory = self.script_inventory()
hosts = inventory.list_hosts("norse")
@ -135,7 +132,6 @@ class TestInventory(unittest.TestCase):
assert sorted(hosts) == sorted(expected_hosts)
def test_script_combined(self):
raise SkipTest
inventory = self.script_inventory()
hosts = inventory.list_hosts("norse:greek")
@ -143,7 +139,6 @@ class TestInventory(unittest.TestCase):
assert sorted(hosts) == sorted(expected_hosts)
def test_script_restrict(self):
raise SkipTest
inventory = self.script_inventory()
restricted_hosts = ['hera', 'poseidon', 'thor']
@ -160,10 +155,11 @@ class TestInventory(unittest.TestCase):
assert sorted(hosts) == sorted(expected_hosts)
def test_script_vars(self):
raise SkipTest
inventory = self.script_inventory()
vars = inventory.get_variables('thor')
print "VARS=%s" % vars
assert vars == {'hammer':True,
'group_names': ['norse'],
'inventory_hostname': 'thor'}