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

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

(cherry picked from commit a6bbf31d0b907181e6afa9e198ca42c07d681055)
This commit is contained in:
Alejandro Huertas Herrero 2021-04-09 16:32:26 +02:00 committed by Ruben S. Montero
parent 22d6747229
commit b55b970da8
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

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