From eb9bed3715ea3b1db9244d642733e4d76da46fb9 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Thu, 28 Nov 2024 02:10:40 +0530 Subject: [PATCH] Update docker.rb for Podman --- lib/facter/docker.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/facter/docker.rb b/lib/facter/docker.rb index 368c12e6..a5302e47 100644 --- a/lib/facter/docker.rb +++ b/lib/facter/docker.rb @@ -138,7 +138,11 @@ def interfaces docker_network_names.each do |network| inspect = JSON.parse(Facter::Core::Execution.execute("#{docker_command} network inspect #{network}", timeout: 90)) docker['network'][network] = inspect[0] - network_id = docker['network'][network]['Id'][0..11] + network_id = if docker['network'][network]['Id'].nil? + docker['network'][network]['id'][0..11] + else + docker['network'][network]['Id'][0..11] + end interfaces.each do |iface| docker['network']['managed_interfaces'][iface] = network if %r{#{network_id}}.match?(iface) end