1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-08 21:17:43 +03:00

B #5311: show CLI errors always on STDERR (#1087)

This commit is contained in:
Alejandro Huertas Herrero 2021-04-09 16:32:26 +02:00 committed by GitHub
parent 85acc4b703
commit a6bbf31d0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -481,9 +481,12 @@ module CommandParser
begin
rc = comm[:proc].call
if rc.instance_of?(Array)
if rc.instance_of?(Array) && rc[0] != 0
STDERR.puts rc[1]
exit(rc[0])
elsif rc.instance_of?(Array)
puts rc[1]
exit rc.first
exit(rc[0])
else
exit(@exit_code || rc)
end