Permalink
Browse files

[OHAI-412] fix uptime plugins for seconds_to_human change

Previously there was a _seconds_to_human method defined by the top level
uptime plugin, but this was moved to a mixin and the leading underscore
removed from the method name.
  • Loading branch information...
danielsdeleo committed Oct 24, 2012
1 parent 894c847 commit 0a43b8743312a3b1e953b8f79c9a4c9a2920d19a
@@ -25,7 +25,7 @@
stdout.each do |line|
if line =~ /kern.boottime:\D+(\d+)/
uptime_seconds Time.new.to_i - $1.to_i
- uptime self._seconds_to_human(uptime_seconds)
+ uptime seconds_to_human(uptime_seconds)
end
end
end
@@ -25,7 +25,7 @@
stdout.each do |line|
if line =~ /kern.boottime:\D+(\d+)/
uptime_seconds Time.new.to_i - $1.to_i
- uptime self._seconds_to_human(uptime_seconds)
+ uptime seconds_to_human(uptime_seconds)
end
end
end
@@ -25,7 +25,7 @@
stdout.each do |line|
if line =~ /kern.boottime:\D+(\d+)/
uptime_seconds Time.new.to_i - $1.to_i
- uptime self._seconds_to_human(uptime_seconds)
+ uptime seconds_to_human(uptime_seconds)
end
end
end
@@ -25,7 +25,7 @@
stdout.each do |line|
if line =~ /kern.boottime=(.+)/
uptime_seconds Time.new.to_i - Time.parse($1).to_i
- uptime self._seconds_to_human(uptime_seconds)
+ uptime seconds_to_human(uptime_seconds)
end
end
end
@@ -24,4 +24,4 @@
uptime = sigar.uptime.uptime
uptime_seconds uptime.to_i * 1000
-uptime self._seconds_to_human(uptime.to_i)
+uptime seconds_to_human(uptime.to_i)
@@ -29,7 +29,7 @@
stdout.each do |line|
if line =~ /.* boot (.+)/
uptime_seconds Time.now.to_i - DateTime.parse($1).strftime('%s').to_i
- uptime self._seconds_to_human(uptime_seconds)
+ uptime seconds_to_human(uptime_seconds)
break
end
end
@@ -20,4 +20,4 @@
provides "uptime", "uptime_seconds"
uptime_seconds ::WMI::Win32_PerfFormattedData_PerfOS_System.find(:first).SystemUpTime.to_i
-uptime self._seconds_to_human(uptime_seconds)
+uptime seconds_to_human(uptime_seconds)

0 comments on commit 0a43b87

Please sign in to comment.