From 444ba917eb15d4f1a74d87cf0008e2d326eda9ed Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 19 Oct 2017 10:02:30 -0400 Subject: [PATCH] Have node*attrib commands error if user does -c and = Can't clear and assign in one go, error for user awareness. --- confluent_client/bin/nodeattrib | 4 ++++ confluent_client/bin/nodegroupattrib | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/confluent_client/bin/nodeattrib b/confluent_client/bin/nodeattrib index 5db662a1..b9a9a787 100755 --- a/confluent_client/bin/nodeattrib +++ b/confluent_client/bin/nodeattrib @@ -63,6 +63,10 @@ nodetype="noderange" if len(args) > 1: if "=" in args[1] or options.clear: + if "=" in args[1] and options.clear: + print("Can not clear and set at the same time!") + argparser.print_help() + sys.exit(1) exitcode=client.updateattrib(session,args,nodetype, noderange, options) try: # setting user output to what the user inputs diff --git a/confluent_client/bin/nodegroupattrib b/confluent_client/bin/nodegroupattrib index a7915f13..3ad27614 100755 --- a/confluent_client/bin/nodegroupattrib +++ b/confluent_client/bin/nodegroupattrib @@ -63,6 +63,10 @@ exitcode = 0 if len(args) > 1: showtype = 'all' + if "=" in args[1] and options.clear: + print("Can not clear and set at the same time!") + argparser.print_help() + sys.exit(1) exitcode=client.updateattrib(session,args,nodetype, nodegroups, options) try: # setting user output to what the user inputs