Fix neutron_network for --router:external setting
Neutron can't be called with --router:external=True as that will cause "ignored explicit argument u'True'" error. Change-Id: I49a033fd2821100283e217225896fc93a927edd2
This commit is contained in:
parent
2b530fca23
commit
b29ee6f706
@ -80,8 +80,8 @@ Puppet::Type.type(:neutron_network).provide(
|
||||
"--provider:segmentation_id=#{@resource[:provider_segmentation_id]}"
|
||||
end
|
||||
|
||||
if @resource[:router_external]
|
||||
network_opts << "--router:external=#{@resource[:router_external]}"
|
||||
if @resource[:router_external] == 'True'
|
||||
network_opts << '--router:external'
|
||||
end
|
||||
|
||||
results = auth_neutron('net-create', '--format=shell',
|
||||
@ -120,7 +120,11 @@ Puppet::Type.type(:neutron_network).provide(
|
||||
end
|
||||
|
||||
def router_external=(value)
|
||||
auth_neutron('net-update', "--router:external=#{value}", name)
|
||||
if value == 'False'
|
||||
auth_neutron('net-update', "--router:external=#{value}", name)
|
||||
else
|
||||
auth_neutron('net-update', "--router:external", name)
|
||||
end
|
||||
end
|
||||
|
||||
[
|
||||
|
@ -46,7 +46,14 @@ describe provider_class do
|
||||
|
||||
it 'should call net-update to change router_external' do
|
||||
provider.expects(:auth_neutron).with('net-update',
|
||||
'--router:external=True',
|
||||
'--router:external=False',
|
||||
net_name)
|
||||
provider.router_external=('False')
|
||||
end
|
||||
|
||||
it 'should call net-update to change router_external' do
|
||||
provider.expects(:auth_neutron).with('net-update',
|
||||
'--router:external',
|
||||
net_name)
|
||||
provider.router_external=('True')
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user