(maint) Return nil on sysctl command lookup fail
See also 7fc668519f8e.
Adrien Thebo
10 years ago
27 | 27 | end |
28 | 28 | |
29 | 29 | def self.uptime_sysctl |
30 | output = Facter::Core::Execution.exec("#{uptime_sysctl_cmd} 2>/dev/null") | |
30 | output = Facter::Core::Execution.exec("#{uptime_sysctl_cmd} 2>/dev/null", :on_fail => nil) | |
31 | 31 | if not output.empty? |
32 | 32 | compute_uptime(Time.at(output.match(/\d+/)[0].to_i)) |
33 | 33 | end |