From d582636e47688be98c78ff82243fd1338f59973a Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Fri, 16 Sep 2011 12:09:37 +0200 Subject: [PATCH] bug: wrong access to exitstatus (cherry picked from commit 1aad41ffe6990fad4f7a57d2291cb92d888216fb) --- src/mad/ruby/scripts_common.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mad/ruby/scripts_common.rb b/src/mad/ruby/scripts_common.rb index c5a7119b79..ba24205e20 100644 --- a/src/mad/ruby/scripts_common.rb +++ b/src/mad/ruby/scripts_common.rb @@ -53,7 +53,8 @@ module OpenNebula # the command fails def self.exec_and_log(command, message=nil) output=`#{command} 2>&1 1>/dev/null` - code=$? + code=$?.exitstatus + if code!=0 log_error "Command \"#{command}\" failed." log_error output