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