diff --git a/src/cli/one_helper.rb b/src/cli/one_helper.rb index f1ce493baa..8bd8d69115 100644 --- a/src/cli/one_helper.rb +++ b/src/cli/one_helper.rb @@ -398,7 +398,8 @@ EOT editor_path = ENV["EDITOR"] ? ENV["EDITOR"] : EDITOR_PATH system("#{editor_path} #{path}") - unless $?==0 + + unless $?.exitstatus == 0 puts "Editor not defined" exit -1 end diff --git a/src/im_mad/remotes/kvm.d/kvm.rb b/src/im_mad/remotes/kvm.d/kvm.rb index ec857ccfd2..9fd51c7eb6 100755 --- a/src/im_mad/remotes/kvm.d/kvm.rb +++ b/src/im_mad/remotes/kvm.d/kvm.rb @@ -27,7 +27,7 @@ end ###### nodeinfo_text = `virsh -c qemu:///system nodeinfo` -exit(-1) if $?!=0 +exit(-1) if $?.exitstatus != 0 nodeinfo_text.split(/\n/).each{|line| if line.match('^CPU\(s\)') @@ -46,7 +46,7 @@ nodeinfo_text.split(/\n/).each{|line| NETINTERFACE = "eth1" top_text=`top -bin2` -exit(-1) if $?!=0 +exit(-1) if $?.exitstatus != 0 top_text.gsub!(/^top.*^top.*?$/m, "") # Strip first top output @@ -72,7 +72,7 @@ $used_memory=tmp[0] $free_memory=tmp[1] net_text=`cat /proc/net/dev` -exit(-1) if $?!=0 +exit(-1) if $?.exitstatus != 0 net_text.split(/\n/).each{|line| if line.match("^ *#{NETINTERFACE}") diff --git a/src/im_mad/remotes/xen.d/xen.rb b/src/im_mad/remotes/xen.d/xen.rb index 0fe19b7673..c979907522 100755 --- a/src/im_mad/remotes/xen.d/xen.rb +++ b/src/im_mad/remotes/xen.d/xen.rb @@ -27,10 +27,10 @@ def print_info(name, value) end xentop_text=`sudo #{XENTOP_PATH} -bi2` -exit(-1) if $?!=0 +exit(-1) if $?.exitstatus != 0 xm_text=`sudo #{XM_PATH} info` -exit(-1) if $?!=0 +exit(-1) if $?.exitstatus != 0 #xentop_text.gsub!(/^xentop.*^xentop.*?$/m, "") # Strip first top output xentop_text.gsub!("no limit", "no_limit")