lib/facter/facts/linux/system_uptime/seconds.rb in facter-4.0.34 vs lib/facter/facts/linux/system_uptime/seconds.rb in facter-4.0.35
- old
+ new
@@ -6,10 +6,16 @@
class Seconds
FACT_NAME = 'system_uptime.seconds'
ALIASES = 'uptime_seconds'
def call_the_resolver
- fact_value = Facter::Resolvers::Uptime.resolve(:seconds)
+ hypervisors = Facter::Resolvers::Containers.resolve(:hypervisor)
+
+ fact_value = if hypervisors && hypervisors[:docker]
+ Facter::Resolvers::Linux::DockerUptime.resolve(:seconds)
+ else
+ Facter::Resolvers::Uptime.resolve(:seconds)
+ end
[Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
end
end
end