Fix hosts being in multiple groups, and duplicate host references in the same inventory file.

This commit is contained in:
Michael DeHaan
2012-05-19 17:24:54 -04:00
parent 7302b7bbc4
commit 8e88667f82
3 changed files with 27 additions and 3 deletions

View File

@@ -128,9 +128,9 @@ class TestInventory(unittest.TestCase):
print vars
expected = dict(
a='1', b='2', c='3', d='100002',
a='1', b='2', c='3', d='100002', rga='1', rgb='2', rgc='3',
inventory_hostname='rtp_a',
group_names=[ 'eastcoast', 'nc', 'rtp', 'us' ]
group_names=[ 'eastcoast', 'nc', 'redundantgroup', 'redundantgroup2', 'redundantgroup3', 'rtp', 'us' ]
)
print vars
print expected

View File

@@ -12,6 +12,24 @@ florida
[us:children]
eastcoast
[redundantgroup]
rtp_a
[redundantgroup2]
rtp_a
[redundantgroup3:children]
rtp
[redundantgroup:vars]
rga=1
[redundantgroup2:vars]
rgb=2
[redundantgroup3:vars]
rgc=3
[nc:vars]
b=10000
c=10001