mirror of
https://github.com/xcat2/confluent.git
synced 2026-01-04 15:12:29 +00:00
Fix noderun in same way as nodeshell
noderun had a similar issue about error handling.
This commit is contained in:
@@ -59,7 +59,10 @@ def run():
|
||||
|
||||
for exp in c.create('/noderange/{0}/attributes/expression'.format(args[0]),
|
||||
{'expression': cmdstr}):
|
||||
ex = exp['databynode']
|
||||
if 'error' in exp:
|
||||
sys.stderr.write(exp['error'] + '\n')
|
||||
exitcode |= exp.get('errorcode', 1)
|
||||
ex = exp.get('databynode', ())
|
||||
for node in ex:
|
||||
cmd = ex[node]['value'].encode('utf-8')
|
||||
cmdv = shlex.split(cmd)
|
||||
@@ -68,7 +71,8 @@ def run():
|
||||
run_cmdv(node, cmdv, all, pipedesc)
|
||||
else:
|
||||
pendingexecs.append((node, cmdv))
|
||||
|
||||
if not all or exitcode:
|
||||
sys.exit(exitcode)
|
||||
exitcode = 0
|
||||
rdy, _, _ = select.select(all, [], [], 10)
|
||||
while all:
|
||||
|
||||
@@ -72,9 +72,7 @@ def run():
|
||||
run_cmdv(node, cmdv, all, pipedesc)
|
||||
else:
|
||||
pendingexecs.append((node, cmdv))
|
||||
if not all:
|
||||
sys.exit(exitcode)
|
||||
if exitcode:
|
||||
if not all or exitcode
|
||||
sys.exit(exitcode)
|
||||
rdy, _, _ = select.select(all, [], [], 10)
|
||||
while all:
|
||||
|
||||
Reference in New Issue
Block a user