2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-12 10:49:17 +00:00

Fix nodepower argument parsing

nodepower was assuming that the second parameter was always the
state regardless of option parsing.  Use args instead to fix.
This commit is contained in:
Jarrod Johnson 2018-07-18 11:00:01 -04:00
parent b7fe72673d
commit 6993e0b496

View File

@ -45,11 +45,11 @@ except IndexError:
sys.exit(1)
client.check_globbing(noderange)
setstate = None
if len(sys.argv) > 2:
if len(args) > 1:
if setstate == 'softoff':
setstate = 'shutdown'
elif not sys.argv[2] in ('stat', 'state', 'status'):
setstate = sys.argv[2]
elif not args[1] in ('stat', 'state', 'status'):
setstate = args[1]
if setstate not in (None, 'on', 'off', 'shutdown', 'boot', 'reset'):
argparser.print_help()