Skip to content

Commit 8a896dd

Browse files
davejrtscotty-c
authored andcommitted
Docker network (#331)
* fixes puppet run failures with no IPAM driver * fixing variables so nil values dont cause failures
1 parent 38810ae commit 8a896dd

File tree

1 file changed

+2
-2
lines changed
  • lib/puppet/provider/docker_network

1 file changed

+2
-2
lines changed

lib/puppet/provider/docker_network/ruby.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def self.instances
3838
_, name, driver = line.split(' ')
3939
inspect = docker(['network', 'inspect', name])
4040
obj = JSON.parse(inspect).first
41-
ipam_driver = unless obj['IPAM']['Driver'].empty?
41+
ipam_driver = unless obj['IPAM']['Driver'].nil?
4242
obj['IPAM']['Driver']
4343
end
44-
subnet = unless obj['IPAM']['Config'].empty?
44+
subnet = unless obj['IPAM']['Config'].nil?
4545
if obj['IPAM']['Config'].first.key? 'Subnet'
4646
obj['IPAM']['Config'].first['Subnet']
4747
end

0 commit comments

Comments
 (0)