fix nodegroup_comp func

This commit is contained in:
allan 2014-06-25 10:44:23 +08:00
parent f096375d25
commit cddc1c8397
2 changed files with 6 additions and 2 deletions

View File

@ -1263,7 +1263,6 @@ class LocalClient(object):
)
tgt = salt.utils.minions.nodegroup_comp(tgt,
self.opts['nodegroups'])
tgt = tgt[:-3]
expr_form = 'compound'
# Convert a range expression to a list of nodes and change expression

View File

@ -65,8 +65,10 @@ def nodegroup_comp(group, nodegroups, skip=None):
'''
Take the nodegroup and the nodegroups and fill in nodegroup refs
'''
k = 1
if skip is None:
skip = set([group])
k = 0
if group not in nodegroups:
return ''
gstr = nodegroups[group]
@ -80,7 +82,10 @@ def nodegroup_comp(group, nodegroups, skip=None):
continue
skip.add(ngroup)
ret += nodegroup_comp(ngroup, nodegroups, skip)
if k == 1:
return ret
else:
return ret[:-3]
class CkMinions(object):