diff --git a/confluent_client/bin/nodeconfig b/confluent_client/bin/nodeconfig index 76a0fd72..07f6431f 100755 --- a/confluent_client/bin/nodeconfig +++ b/confluent_client/bin/nodeconfig @@ -202,12 +202,14 @@ else: for path in queryparms: if options.comparedefault: continue - client.print_attrib_path(path, session, list(queryparms[path]), - NullOpt(), queryparms[path]) + rc = client.print_attrib_path(path, session, list(queryparms[path]), + NullOpt(), queryparms[path]) + if rc: + sys.exit(rc) if printsys or options.exclude: if printsys == 'all': printsys = [] path = '/noderange/{0}/configuration/system/all'.format(noderange) - client.print_attrib_path(path, session, printsys, - options) + rcode = client.print_attrib_path(path, session, printsys, + options) sys.exit(rcode) \ No newline at end of file diff --git a/confluent_client/confluent/client.py b/confluent_client/confluent/client.py index c7d4b569..6b3ae129 100644 --- a/confluent_client/confluent/client.py +++ b/confluent_client/confluent/client.py @@ -338,6 +338,12 @@ def print_attrib_path(path, session, requestargs, options, rename=None): for attr, val in sorted( res['databynode'][node].items(), key=lambda (k, v): v.get('sortid', k) if isinstance(v, dict) else k): + if attr == 'error': + sys.stderr.write('{0}: Error: {1}\n'.format(node, val)) + continue + if attr == 'errorcode': + exitcode |= val + continue seenattributes.add(attr) if rename: printattr = rename.get(attr, attr)