mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-12 02:38:20 +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:
parent
b7fe72673d
commit
6993e0b496
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user