diff --git a/confluent_client/bin/nodeconfig b/confluent_client/bin/nodeconfig index 4746c4b6..9c84fb0e 100755 --- a/confluent_client/bin/nodeconfig +++ b/confluent_client/bin/nodeconfig @@ -327,7 +327,7 @@ async def main(): else: path = '/noderange/{0}/configuration/system/advanced'.format( noderange) - rcode = await client.print_attrib_path(path, session, printsys, + rcode |= await client.print_attrib_path(path, session, printsys, options) sys.exit(rcode) diff --git a/confluent_client/bin/nodesensors b/confluent_client/bin/nodesensors index 0130e800..40fc8e7b 100755 --- a/confluent_client/bin/nodesensors +++ b/confluent_client/bin/nodesensors @@ -107,7 +107,7 @@ def sensorpass(showout=True, appendtime=False): if 'error' in reading: sys.stderr.write('Error: {0}\n'.format(reading['error'])) if 'errorcode' in reading: - exitcode |= exitcode + exitcode |= reading['errorcode'] else: exitcode |= 1 if 'databynode' not in reading: @@ -120,6 +120,10 @@ def sensorpass(showout=True, appendtime=False): sys.stderr.write( '{0}: Error: {1}\n'.format(node, reading[node]['error'])) + if 'errorcode' in reading[node]: + exitcode |= reading[node]['errorcode'] + else: + exitcode |= 1 if 'sensors' not in reading[node]: continue for sensedata in reading[node]['sensors']: @@ -261,3 +265,6 @@ try: except KeyboardInterrupt: print('') sys.exit(0) +# Falling off the end exited 0 whatever sensorpass recorded, so only the +# --interval path ever reported a failed read. +sys.exit(exitcode)