2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-29 04:50:21 +00:00

Make noderange attribute pass through API better

On the plugin front, add a one-off description for the 'noderange' attribute.
For the other pieces, make noderange more like any 'extensible' string value
rather than making it special.
This commit is contained in:
Jarrod Johnson 2015-03-12 15:59:25 -04:00
parent 0515acd054
commit 9f16375b14
3 changed files with 4 additions and 3 deletions

View File

@ -819,8 +819,6 @@ class ConfigManager(object):
for attr in attribmap[group].iterkeys():
if attr == 'nodes':
newdict = set(attribmap[group][attr])
elif attr == 'noderange':
newdict = attribmap[group][attr]
elif (isinstance(attribmap[group][attr], str) or
isinstance(attribmap[group][attr], unicode)):
newdict = {'value': attribmap[group][attr]}

View File

@ -139,7 +139,8 @@ class NodeRange(object):
grpcfg = self.cfm.get_nodegroup_attributes(element)
nodes = grpcfg['nodes']
if 'noderange' in grpcfg and grpcfg['noderange']:
nodes |= NodeRange(grpcfg['noderange'], self.cfm).nodes
nodes |= NodeRange(
grpcfg['noderange']['value'], self.cfm).nodes
return nodes
if '-' in element and ':' not in element:
return self.expandrange(element, '-')

View File

@ -55,6 +55,8 @@ def retrieve_nodegroup(nodegroup, element, configmanager, inputdata):
currattr = grpcfg[attribute]
if attribute == 'nodes':
desc = 'The nodes belonging to this group'
elif attribute == 'noderange':
desc = 'A dynamic noderange that this group refers to in noderange expansion'
else:
try:
desc = allattributes.node[attribute]['description']