diff --git a/lib/puppet/provider/docker_network/ruby.rb b/lib/puppet/provider/docker_network/ruby.rb index 9489dace..d00df593 100644 --- a/lib/puppet/provider/docker_network/ruby.rb +++ b/lib/puppet/provider/docker_network/ruby.rb @@ -38,6 +38,9 @@ def self.instances _, name, driver = line.split(' ') inspect = docker(['network', 'inspect', name]) obj = JSON.parse(inspect).first + ipam_driver = unless obj['IPAM']['Driver'].empty? + obj['IPAM']['Driver'] + end subnet = unless obj['IPAM']['Config'].empty? if obj['IPAM']['Config'].first.key? 'Subnet' obj['IPAM']['Config'].first['Subnet'] @@ -46,7 +49,7 @@ def self.instances new( :name => name, :id => obj['Id'], - :ipam_driver => obj['IPAM']['Driver'], + :ipam_driver => ipam_driver, :subnet => subnet, :ensure => :present, :driver => driver,