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