Skip to content

Commit

Permalink
Use networking.interfaces fact
Browse files Browse the repository at this point in the history
  • Loading branch information
vStone committed Jan 15, 2025
1 parent c99e45e commit 81ac9e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/facter/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
end

def interfaces
Facter.value(:interfaces).split(',')
Facter.value('networking.interfaces').keys
end

Facter.add(:docker_version) do
Expand Down
7 changes: 6 additions & 1 deletion spec/unit/lib/facter/docker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@

describe 'docker fact with composer network' do
before :each do
allow(Facter.fact(:interfaces)).to receive(:value).and_return('br-c5810f1e3113,docker0,eth0,lo')
allow(Facter.fact('networking.interfaces')).to receive(:value).and_return({
'br-c5810f1e3113' => {},
'docker0' => {},
'eth0' => {},
'lo' => {},
})
end

it do
Expand Down

0 comments on commit 81ac9e3

Please sign in to comment.