Correctly add ungrouped hosts to 'ungrouped' in YAML inventory.

This commit is contained in:
Jeroen Hoekx
2012-06-26 11:38:10 +02:00
parent afb2e3e5ac
commit d592e15dcc
3 changed files with 30 additions and 19 deletions

View File

@@ -222,14 +222,14 @@ class TestInventory(unittest.TestCase):
inventory = self.yaml_inventory()
hosts = inventory.list_hosts()
print hosts
expected_hosts=['jupiter', 'saturn', 'zeus', 'hera', 'poseidon', 'thor', 'odin', 'loki']
expected_hosts=['jupiter', 'saturn', 'mars', 'zeus', 'hera', 'poseidon', 'thor', 'odin', 'loki']
self.compare(hosts, expected_hosts)
def test_yaml_all(self):
inventory = self.yaml_inventory()
hosts = inventory.list_hosts('all')
expected_hosts=['jupiter', 'saturn', 'zeus', 'hera', 'poseidon', 'thor', 'odin', 'loki']
expected_hosts=['jupiter', 'saturn', 'mars', 'zeus', 'hera', 'poseidon', 'thor', 'odin', 'loki']
self.compare(hosts, expected_hosts)
def test_yaml_norse(self):
@@ -243,7 +243,7 @@ class TestInventory(unittest.TestCase):
inventory = self.yaml_inventory()
hosts = inventory.list_hosts("ungrouped")
expected_hosts=['jupiter']
expected_hosts=['jupiter', 'mars']
self.compare(hosts, expected_hosts)
def test_yaml_combined(self):

View File

@@ -6,6 +6,8 @@
moon: titan
moon2: enceladus
- host: mars
- host: zeus
vars:
- ansible_ssh_port: 3001