2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-12-25 12:41:39 +00:00

Fix nodelist handling of bad noderange

When attributes were specified with an incorrect noderange
it was failing to report the noderange error.  If that were
specifically addressed, it would then proceed to erroneously
complain about valid attribute names.
This commit is contained in:
Jarrod Johnson 2015-10-19 14:09:37 -04:00
parent e53a9f83f4
commit 61a0a66486

View File

@ -42,6 +42,10 @@ exitcode = 0
if len(args) > 1:
seenattributes = set([])
for res in session.read('/noderange/{0}/attributes/all'.format(noderange)):
if 'error' in res:
sys.stderr.write(res['error'])
exitcode = 1
continue
for node in res['databynode']:
for attr in res['databynode'][node]:
seenattributes.add(attr)
@ -71,11 +75,11 @@ if len(args) > 1:
if blamedata:
attrout += ' (' + ', '.join(blamedata) + ')'
print attrout
for attr in args[1:]:
if attr not in seenattributes:
sys.stderr.write('Error: {0} not a valid attribute\n'.format(attr))
exitcode = 1
if not exitcode:
for attr in args[1:]:
if attr not in seenattributes:
sys.stderr.write('Error: {0} not a valid attribute\n'.format(attr))
exitcode = 1
else:
for res in session.read(nodelist):
if 'error' in res: