From 6993e0b496c71bc58d0e31a0b649b9ddb797ddcd Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 18 Jul 2018 11:00:01 -0400 Subject: [PATCH] Fix nodepower argument parsing nodepower was assuming that the second parameter was always the state regardless of option parsing. Use args instead to fix. --- confluent_client/bin/nodepower | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/confluent_client/bin/nodepower b/confluent_client/bin/nodepower index a795f63d..10378a1b 100755 --- a/confluent_client/bin/nodepower +++ b/confluent_client/bin/nodepower @@ -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()