From f5f16dac7aee13b47652cc31b965acba338c44fb Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 8 Jun 2021 09:12:33 -0400 Subject: [PATCH] Fix nodebmcreset partial success The error handling is improved, to catch both noderange global issues as well as partial completions. --- confluent_client/bin/nodebmcreset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_client/bin/nodebmcreset b/confluent_client/bin/nodebmcreset index 09a6221b..e18f10aa 100755 --- a/confluent_client/bin/nodebmcreset +++ b/confluent_client/bin/nodebmcreset @@ -47,14 +47,14 @@ exitcode = 0 errorNodes = set([]) session.stop_if_noderange_over(noderange, options.maxnodes) success = session.simple_noderange_command(noderange, 'configuration/management_controller/reset', 'reset', key='state', errnodes=errorNodes) # = 0 if successful -if success != 0: - sys.exit(success) # Determine which nodes were successful and print them allNodes = set([]) for node in session.read('/noderange/{0}/nodes/'.format(noderange)): + if 'error' in node and success != 0: + sys.exit(success) allNodes.add(node['item']['href'].replace("/", "")) goodNodes = allNodes - errorNodes