diff options
author | Paul Belanger <pabelanger@redhat.com> | 2018-04-06 13:49:13 -0400 |
---|---|---|
committer | James E. Blair <jeblair@redhat.com> | 2018-04-30 12:59:13 -0700 |
commit | 5d26bf8407a21ba32cc7d84193d5ac2bf83af743 (patch) | |
tree | 6b6bf0164b6981680b3cb01ab2a65627ca8fb618 /tests | |
parent | 2a67365a7c84c244c597d32557f6d962211631c2 (diff) | |
download | zuul-5d26bf8407a21ba32cc7d84193d5ac2bf83af743.tar.gz |
Inventory groups should be under children key
When writing ansible inventory files as yaml, we should be using add
them under the children key per the official documentation:
https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#hosts-and-groups
This is the first step to allowing groups of groups for an inventory.
Change-Id: Id1e14d0364dd06af0371ca027031e46fb5f73e92
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_inventory.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/unit/test_inventory.py b/tests/unit/test_inventory.py index b7e35ebd2..30fa10c4d 100644 --- a/tests/unit/test_inventory.py +++ b/tests/unit/test_inventory.py @@ -89,14 +89,16 @@ class TestInventory(ZuulTestCase): all_nodes = ('controller', 'compute1', 'compute2') self.assertIn('all', inventory) + self.assertIn('children', inventory['all']) self.assertIn('hosts', inventory['all']) self.assertIn('vars', inventory['all']) for group_name in ('ceph-osd', 'ceph-monitor'): - self.assertIn(group_name, inventory) + self.assertIn(group_name, inventory['all']['children']) for node_name in all_nodes: self.assertIn(node_name, inventory['all']['hosts']) self.assertIn(node_name, - inventory['ceph-monitor']['hosts']) + inventory['all']['children'] + ['ceph-monitor']['hosts']) self.assertIn('zuul', inventory['all']['vars']) z_vars = inventory['all']['vars']['zuul'] self.assertIn('executor', z_vars) |