Change to use non-deprecated security group rule syntax

--src-ip and --src-group were deprecated in 2016, change
to use --remote-ip and --remote-group, respectively.
Related to https://review.opendev.org/#/c/659400/

Change-Id: Ie609380b130410e3548eeacffd72871c6b5722ea
This commit is contained in:
Brian Haley 2019-05-16 10:51:27 -04:00
parent 07993b785d
commit b3028e63ee
2 changed files with 4 additions and 4 deletions

View File

@ -24,9 +24,9 @@ Puppet::Type.type(:nova_security_rule).provide(
end
unless @resource[:ip_range].nil?
opts << "--src-ip" << @resource[:ip_range]
opts << "--remote-ip" << @resource[:ip_range]
else
opts << "--src-group" << @resource[:source_group]
opts << "--remote-group" << @resource[:source_group]
end
@property_hash = self.class.nova_request('security group rule', 'create', nil, opts)
@ -119,4 +119,4 @@ Puppet::Type.type(:nova_security_rule).provide(
resources[name].provider = rule if rule
end
end
end
end

View File

@ -37,7 +37,7 @@ describe provider_class do
describe "#create" do
it 'should create security group rule' do
provider.class.stubs(:openstack)
.with('security group rule', 'create', ['scg0', '--protocol', 'tcp', '--dst-port', '22:23', '--src-ip', '0.0.0.0/0'])
.with('security group rule', 'create', ['scg0', '--protocol', 'tcp', '--dst-port', '22:23', '--remote-ip', '0.0.0.0/0'])
.returns('id="021114fb-67e0-4882-b2ed-e7c5328d8aa8"
protocol="tcp"
port_range_max="22"