Skip to content

Commit f755321

Browse files
adamboutchermalikparvez
authored andcommitted
Update docker.rb for Podman
This if statement will enable the fact to work if you are using podman with docker symlink/support as the json syntax is lowercase on podman but camel/title case on docker. As per - #982
1 parent 5a0775b commit f755321

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/facter/docker.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ def interfaces
138138
docker_network_names.each do |network|
139139
inspect = JSON.parse(Facter::Core::Execution.execute("#{docker_command} network inspect #{network}", timeout: 90))
140140
docker['network'][network] = inspect[0]
141-
network_id = docker['network'][network]['Id'][0..11]
141+
if docker['network'][network]['Id'].nil?
142+
network_id = docker['network'][network]['id'][0..11]
143+
else
144+
network_id = docker['network'][network]['Id'][0..11]
145+
end
142146
interfaces.each do |iface|
143147
docker['network']['managed_interfaces'][iface] = network if %r{#{network_id}}.match?(iface)
144148
end

0 commit comments

Comments
 (0)