gnt-cluster command return codes

9 views
Skip to first unread message

Karl Katzke

unread,
Aug 23, 2012, 7:37:50 PM8/23/12
to gan...@googlegroups.com
I'm using 2.4.5; apologies if this has since been corrected. 

Is there a way to get gnt-cluster to give an exit code of 1 when any one of the executions on each node fails?

For instance, if I run:

# gnt-cluster command /root/test.sh
------------------------------------------------
node: test-01

return code = 0
------------------------------------------------
node: test-02
/foo/bar/ does note exist on test-02

return code = 1
------------------------------------------------
node: test-01

return code = 0

... I would expect that the exit value returned to the shell ( e.g. the output of `echo $?` in bash ) would be set to 1, as there was an error somewhere within the execution process. Instead, the return code is 0, and I have to parse the output to make sure that operator output is or is not required. 

Thanks,
Karl Katzke

Iustin Pop

unread,
Aug 24, 2012, 4:13:22 AM8/24/12
to gan...@googlegroups.com
Right now gnt-cluster command is rather a small tool for easier command
run. For serious usage, I'd recommend instead to look at dsh, which can
take the node list from /var/lib/ganeti/ssconf_online_nodes, and run
with way more options that gnt-cluster command does.

That said, please file an issue, the exit code should indeed be fixed.

thanks,
iustin
Reply all
Reply to author
Forward
0 new messages