Skip to content

Commit

Permalink
Docker network (#331)
Browse files Browse the repository at this point in the history
* fixes puppet run failures with no IPAM driver

* fixing variables so nil values dont cause failures
  • Loading branch information
davejrt authored and scotty-c committed Sep 20, 2018
1 parent 38810ae commit 8a896dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/provider/docker_network/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ def self.instances
_, name, driver = line.split(' ')
inspect = docker(['network', 'inspect', name])
obj = JSON.parse(inspect).first
ipam_driver = unless obj['IPAM']['Driver'].empty?
ipam_driver = unless obj['IPAM']['Driver'].nil?
obj['IPAM']['Driver']
end
subnet = unless obj['IPAM']['Config'].empty?
subnet = unless obj['IPAM']['Config'].nil?
if obj['IPAM']['Config'].first.key? 'Subnet'
obj['IPAM']['Config'].first['Subnet']
end
Expand Down

0 comments on commit 8a896dd

Please sign in to comment.