Remove tenant_* properties

These were deprecated[1] during the past cycle so can be removed now.

[1] 91c9bc3f33

Change-Id: Ib1d2a70a8e40680ebb582cbf4e59a0c018c21447
This commit is contained in:
Takashi Kajinami 2023-03-13 10:53:54 +09:00
parent 4f9ea57cb2
commit 0235eb47aa
13 changed files with 40 additions and 145 deletions

View File

@ -15,14 +15,14 @@ keystone_tenant { 'admin':
neutron_network { 'public': neutron_network { 'public':
ensure => present, ensure => present,
router_external => 'True', router_external => 'True',
tenant_name => 'admin', project_name => 'admin',
} }
neutron_subnet { 'public_subnet': neutron_subnet { 'public_subnet':
ensure => 'present', ensure => 'present',
cidr => '172.24.4.224/28', cidr => '172.24.4.224/28',
network_name => 'public', network_name => 'public',
tenant_name => 'admin', project_name => 'admin',
} }
keystone_tenant { 'demo': keystone_tenant { 'demo':
@ -30,21 +30,21 @@ keystone_tenant { 'demo':
} }
neutron_network { 'private': neutron_network { 'private':
ensure => present, ensure => present,
tenant_name => 'demo', project_name => 'demo',
} }
neutron_subnet { 'private_subnet': neutron_subnet { 'private_subnet':
ensure => present, ensure => present,
cidr => '10.0.0.0/24', cidr => '10.0.0.0/24',
network_name => 'private', network_name => 'private',
tenant_name => 'demo', project_name => 'demo',
} }
# Tenant-private router - assumes network namespace isolation # Tenant-private router - assumes network namespace isolation
neutron_router { 'demo_router': neutron_router { 'demo_router':
ensure => present, ensure => present,
tenant_name => 'demo', project_name => 'demo',
gateway_network_name => 'public', gateway_network_name => 'public',
require => Neutron_subnet['public_subnet'], require => Neutron_subnet['public_subnet'],
} }

View File

@ -42,7 +42,6 @@ Puppet::Type.type(:neutron_network).provide(
:provider_segmentation_id => network[:provider_segmentation_id], :provider_segmentation_id => network[:provider_segmentation_id],
:router_external => network[:router_external], :router_external => network[:router_external],
:shared => network[:shared], :shared => network[:shared],
:tenant_id => network[:project_id],
:project_id => network[:project_id], :project_id => network[:project_id],
:availability_zone_hint => parse_availability_zone_hint(network[:availability_zone_hints]), :availability_zone_hint => parse_availability_zone_hint(network[:availability_zone_hints]),
:mtu => network[:mtu], :mtu => network[:mtu],
@ -80,11 +79,7 @@ Puppet::Type.type(:neutron_network).provide(
opts << '--disable' opts << '--disable'
end end
if @resource[:tenant_name] if @resource[:project_name]
opts << "--project=#{@resource[:tenant_name]}"
elsif @resource[:tenant_id]
opts << "--project=#{@resource[:tenant_id]}"
elsif @resource[:project_name]
opts << "--project=#{@resource[:project_name]}" opts << "--project=#{@resource[:project_name]}"
elsif @resource[:project_id] elsif @resource[:project_id]
opts << "--project=#{@resource[:project_id]}" opts << "--project=#{@resource[:project_id]}"
@ -130,7 +125,6 @@ Puppet::Type.type(:neutron_network).provide(
:provider_segmentation_id => network[:provider_segmentation_id], :provider_segmentation_id => network[:provider_segmentation_id],
:router_external => network[:router_external], :router_external => network[:router_external],
:shared => network[:shared], :shared => network[:shared],
:tenant_id => network[:project_id],
:project_id => network[:project_id], :project_id => network[:project_id],
:availability_zone_hint => self.class.parse_availability_zone_hint(network[:availability_zone_hints]), :availability_zone_hint => self.class.parse_availability_zone_hint(network[:availability_zone_hints]),
:mtu => network[:mtu], :mtu => network[:mtu],
@ -202,8 +196,6 @@ Puppet::Type.type(:neutron_network).provide(
:provider_network_type, :provider_network_type,
:provider_physical_network, :provider_physical_network,
:provider_segmentation_id, :provider_segmentation_id,
:tenant_id,
:tenant_name,
:project_id, :project_id,
:project_name, :project_name,
].each do |attr| ].each do |attr|

View File

@ -38,7 +38,6 @@ Puppet::Type.type(:neutron_port).provide(
:name => port[:name], :name => port[:name],
:id => port[:id], :id => port[:id],
:status => port[:status], :status => port[:status],
:tenant_id => port[:project_id],
:project_id => port[:project_id], :project_id => port[:project_id],
:network_id => port[:network_id], :network_id => port[:network_id],
:network_name => get_network_name(port[:network_id]), :network_name => get_network_name(port[:network_id]),
@ -96,11 +95,7 @@ Puppet::Type.type(:neutron_port).provide(
end end
end end
if @resource[:tenant_name] if @resource[:project_name]
opts << "--project=#{@resource[:tenant_name]}"
elsif @resource[:tenant_id]
opts << "--project=#{@resource[:tenant_id]}"
elsif @resource[:project_name]
opts << "--project=#{@resource[:project_name]}" opts << "--project=#{@resource[:project_name]}"
elsif @resource[:project_id] elsif @resource[:project_id]
opts << "--project=#{@resource[:project_id]}" opts << "--project=#{@resource[:project_id]}"
@ -122,7 +117,6 @@ Puppet::Type.type(:neutron_port).provide(
:name => port[:name], :name => port[:name],
:id => port[:id], :id => port[:id],
:status => port[:status], :status => port[:status],
:tenant_id => port[:project_id],
:project_id => port[:project_id], :project_id => port[:project_id],
:network_id => port[:network_id], :network_id => port[:network_id],
:network_name => self.class.get_network_name(port[:network_id]), :network_name => self.class.get_network_name(port[:network_id]),
@ -217,8 +211,6 @@ Puppet::Type.type(:neutron_port).provide(
:ip_address, :ip_address,
:project_id, :project_id,
:project_name, :project_name,
:tenant_id,
:tenant_name,
].each do |attr| ].each do |attr|
define_method(attr.to_s + "=") do |value| define_method(attr.to_s + "=") do |value|
fail("Property #{attr.to_s} does not support being updated") fail("Property #{attr.to_s} does not support being updated")

View File

@ -41,7 +41,6 @@ Puppet::Type.type(:neutron_router).provide(
:status => router[:status], :status => router[:status],
:distributed => router[:distributed], :distributed => router[:distributed],
:ha => router[:ha], :ha => router[:ha],
:tenant_id => router[:project_id],
:project_id => router[:project_id], :project_id => router[:project_id],
:availability_zone_hint => parse_availability_zone_hint(router[:availability_zone_hints]) :availability_zone_hint => parse_availability_zone_hint(router[:availability_zone_hints])
) )
@ -74,11 +73,7 @@ Puppet::Type.type(:neutron_router).provide(
opts << '--disable' opts << '--disable'
end end
if @resource[:tenant_name] if @resource[:project_name]
opts << "--project=#{@resource[:tenant_name]}"
elsif @resource[:tenant_id]
opts << "--project=#{@resource[:tenant_id]}"
elsif @resource[:project_name]
opts << "--project=#{@resource[:project_name]}" opts << "--project=#{@resource[:project_name]}"
elsif @resource[:project_id] elsif @resource[:project_id]
opts << "--project=#{@resource[:project_id]}" opts << "--project=#{@resource[:project_id]}"
@ -128,7 +123,6 @@ Puppet::Type.type(:neutron_router).provide(
:status => router[:status], :status => router[:status],
:distributed => router[:distributed], :distributed => router[:distributed],
:ha => router[:ha], :ha => router[:ha],
:tenant_id => router[:project_id],
:project_id => router[:project_id], :project_id => router[:project_id],
:availability_zone_hint => self.class.parse_availability_zone_hint(router[:availability_zone_hints]) :availability_zone_hint => self.class.parse_availability_zone_hint(router[:availability_zone_hints])
} }
@ -213,8 +207,6 @@ Puppet::Type.type(:neutron_router).provide(
[ [
:availability_zone_hint, :availability_zone_hint,
:tenant_id,
:tenant_name,
:project_id, :project_id,
:project_name :project_name
].each do |attr| ].each do |attr|

View File

@ -47,7 +47,6 @@ Puppet::Type.type(:neutron_subnet).provide(
:enable_dhcp => subnet[:enable_dhcp], :enable_dhcp => subnet[:enable_dhcp],
:network_id => subnet[:network_id], :network_id => subnet[:network_id],
:network_name => get_network_name(subnet[:network_id]), :network_name => get_network_name(subnet[:network_id]),
:tenant_id => subnet[:project_id],
:project_id => subnet[:project_id], :project_id => subnet[:project_id],
) )
end end
@ -159,11 +158,7 @@ Puppet::Type.type(:neutron_subnet).provide(
end end
end end
if @resource[:tenant_name] if @resource[:project_name]
opts << "--project=#{@resource[:tenant_name]}"
elsif @resource[:tenant_id]
opts << "--project=#{@resource[:tenant_id]}"
elsif @resource[:project_name]
opts << "--project=#{@resource[:project_name]}" opts << "--project=#{@resource[:project_name]}"
elsif @resource[:project_id] elsif @resource[:project_id]
opts << "--project=#{@resource[:project_id]}" opts << "--project=#{@resource[:project_id]}"
@ -193,7 +188,6 @@ Puppet::Type.type(:neutron_subnet).provide(
:enable_dhcp => subnet[:enable_dhcp], :enable_dhcp => subnet[:enable_dhcp],
:network_id => subnet[:network_id], :network_id => subnet[:network_id],
:network_name => self.class.get_network_name(subnet[:network_id]), :network_name => self.class.get_network_name(subnet[:network_id]),
:tenant_id => subnet[:project_id],
:project_id => subnet[:project_id], :project_id => subnet[:project_id],
} }
end end
@ -280,8 +274,6 @@ Puppet::Type.type(:neutron_subnet).provide(
:ipv6_ra_mode, :ipv6_ra_mode,
:ipv6_address_mode, :ipv6_address_mode,
:network_id, :network_id,
:tenant_id,
:tenant_name,
:project_id, :project_id,
:project_name, :project_name,
].each do |attr| ].each do |attr|

View File

@ -40,14 +40,6 @@ Puppet::Type.newtype(:neutron_network) do
desc 'A uuid identifying the project which will own the network.' desc 'A uuid identifying the project which will own the network.'
end end
newparam(:tenant_name) do
desc 'The name of the tenant which will own the network.(DEPRECATED)'
end
newproperty(:tenant_id) do
desc 'A uuid identifying the tenant which will own the network.(DEPRECATED)'
end
newproperty(:provider_network_type) do newproperty(:provider_network_type) do
desc 'The physical mechanism by which the virtual network is realized.' desc 'The physical mechanism by which the virtual network is realized.'
newvalues(:flat, :vlan, :local, :gre, :l3_ext, :vxlan) newvalues(:flat, :vlan, :local, :gre, :l3_ext, :vxlan)
@ -95,11 +87,7 @@ Puppet::Type.newtype(:neutron_network) do
end end
autorequire(:keystone_tenant) do autorequire(:keystone_tenant) do
if self[:tenant_name] [self[:project_name]] if self[:project_name]
[self[:tenant_name]]
else
[self[:project_name]] if self[:project_name]
end
end end
validate do validate do
@ -107,16 +95,7 @@ Puppet::Type.newtype(:neutron_network) do
return return
end end
if self[:tenant_id] if self[:project_id] && self[:project_name]
warning('The tenant_id property is deprecated. Use project_id.')
end
if self[:tenant_name]
warning('The tenant_name property is deprecated. Use project_name.')
end
project_id = self[:tenant_id] or self[:project_id]
project_name = self[:tenant_name] or self[:project_name]
if project_id && project_name
raise(Puppet::Error, <<-EOT raise(Puppet::Error, <<-EOT
Please provide a value for only one of project_name and project_id. Please provide a value for only one of project_name and project_id.
EOT EOT

View File

@ -74,14 +74,6 @@ Puppet::Type.newtype(:neutron_port) do
desc 'A uuid identifying the project which will own the port.' desc 'A uuid identifying the project which will own the port.'
end end
newparam(:tenant_name) do
desc 'The name of the tenant which will own the port.(DEPRECATED)'
end
newproperty(:tenant_id) do
desc 'A uuid identifying the tenant which will own the port.(DEPRECATED)'
end
newproperty(:binding_host_id) do newproperty(:binding_host_id) do
desc 'A uuid identifying the host where we will bind the port.' desc 'A uuid identifying the host where we will bind the port.'
end end
@ -101,11 +93,7 @@ Puppet::Type.newtype(:neutron_port) do
end end
autorequire(:keystone_tenant) do autorequire(:keystone_tenant) do
if self[:tenant_name] [self[:project_name]] if self[:project_name]
[self[:tenant_name]]
else
[self[:project_name]] if self[:project_name]
end
end end
autorequire(:neutron_network) do autorequire(:neutron_network) do
@ -117,16 +105,7 @@ Puppet::Type.newtype(:neutron_port) do
end end
validate do validate do
if self[:tenant_id] if self[:project_id] && self[:project_name]
warning('The tenant_id property is deprecated. Use project_id.')
end
if self[:tenant_name]
warning('The tenant_name property is deprecated. Use project_name.')
end
project_id = self[:tenant_id] or self[:project_id]
project_name = self[:tenant_name] or self[:project_name]
if project_id && project_name
raise(Puppet::Error, <<-EOT raise(Puppet::Error, <<-EOT
Please provide a value for only one of project_name and project_id. Please provide a value for only one of project_name and project_id.
EOT EOT

View File

@ -64,24 +64,12 @@ Puppet::Type.newtype(:neutron_router) do
desc 'A uuid identifying the project which will own the router.' desc 'A uuid identifying the project which will own the router.'
end end
newparam(:tenant_name) do
desc 'The name of the tenant which will own the router.(DEPRECATED)'
end
newproperty(:tenant_id) do
desc 'A uuid identifying the tenant which will own the router.(DEPRECATED)'
end
autorequire(:anchor) do autorequire(:anchor) do
['neutron::service::end'] ['neutron::service::end']
end end
autorequire(:keystone_tenant) do autorequire(:keystone_tenant) do
if self[:tenant_name] [self[:project_name]] if self[:project_name]
[self[:tenant_name]]
else
[self[:project_name]] if self[:project_name]
end
end end
autorequire(:neutron_network) do autorequire(:neutron_network) do
@ -113,16 +101,7 @@ Puppet::Type.newtype(:neutron_router) do
return return
end end
if self[:tenant_id] if self[:project_id] && self[:project_name]
warning('The tenant_id property is deprecated. Use project_id.')
end
if self[:tenant_name]
warning('The tenant_name property is deprecated. Use project_name.')
end
project_id = self[:tenant_id] or self[:project_id]
project_name = self[:tenant_name] or self[:project_name]
if project_id && project_name
raise(Puppet::Error, <<-EOT raise(Puppet::Error, <<-EOT
Please provide a value for only one of project_name and project_id. Please provide a value for only one of project_name and project_id.
EOT EOT

View File

@ -88,24 +88,12 @@ Puppet::Type.newtype(:neutron_subnet) do
desc 'A uuid identifying the project which will own the subnet.' desc 'A uuid identifying the project which will own the subnet.'
end end
newparam(:tenant_name) do
desc 'The name of the tenant which will own the subnet.(DEPRECATED)'
end
newproperty(:tenant_id) do
desc 'A uuid identifying the tenant which will own the subnet.(DEPRECATED)'
end
autorequire(:anchor) do autorequire(:anchor) do
['neutron::service::end'] ['neutron::service::end']
end end
autorequire(:keystone_tenant) do autorequire(:keystone_tenant) do
if self[:tenant_name] [self[:project_name]] if self[:project_name]
[self[:tenant_name]]
else
[self[:project_name]] if self[:project_name]
end
end end
autorequire(:neutron_network) do autorequire(:neutron_network) do
@ -135,16 +123,7 @@ EOT
) )
end end
if self[:tenant_id] if self[:project_id] && self[:project_name]
warning('The tenant_id property is deprecated. Use project_id.')
end
if self[:tenant_name]
warning('The tenant_name property is deprecated. Use project_name.')
end
project_id = self[:tenant_id] or self[:project_id]
project_name = self[:tenant_name] or self[:project_name]
if project_id && project_name
raise(Puppet::Error, <<-EOT raise(Puppet::Error, <<-EOT
Please provide a value for only one of project_name and project_id. Please provide a value for only one of project_name and project_id.
EOT EOT

View File

@ -0,0 +1,11 @@
---
upgrade:
- |
The ``tenant_name`` property and the ``tenant_id`` property of the resource
types below have been removed.
- ``neutron_network``
- ``neutron_subnet``
- ``neutron_port``
- ``neutron_router``

View File

@ -53,7 +53,7 @@ mtu="1500"')
provider.create provider.create
expect(provider.exists?).to be_truthy expect(provider.exists?).to be_truthy
expect(provider.admin_state_up).to eq('True') expect(provider.admin_state_up).to eq('True')
expect(provider.tenant_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1') expect(provider.project_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1')
expect(provider.router_external).to eq('False') expect(provider.router_external).to eq('False')
expect(provider.shared).to eq('False') expect(provider.shared).to eq('False')
expect(provider.mtu).to eq('1500') expect(provider.mtu).to eq('1500')
@ -112,12 +112,12 @@ mtu="1500"')
end end
end end
context 'with tenant_name' do context 'with project_name' do
let :net_attrs do let :net_attrs do
{ {
:name => net_name, :name => net_name,
:ensure => 'present', :ensure => 'present',
:tenant_name => 'openstack', :project_name => 'openstack',
} }
end end
@ -322,14 +322,14 @@ mtu="9000"')
expect(instances[0].name).to eq('net1') expect(instances[0].name).to eq('net1')
expect(instances[0].admin_state_up).to eq('True') expect(instances[0].admin_state_up).to eq('True')
expect(instances[0].router_external).to eq('False') expect(instances[0].router_external).to eq('False')
expect(instances[0].tenant_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1') expect(instances[0].project_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1')
expect(instances[0].shared).to eq('False') expect(instances[0].shared).to eq('False')
expect(instances[0].mtu).to eq('1500') expect(instances[0].mtu).to eq('1500')
expect(instances[1].id).to eq('34e8f42b-89db-4a5b-92db-76ca7073414d') expect(instances[1].id).to eq('34e8f42b-89db-4a5b-92db-76ca7073414d')
expect(instances[1].name).to eq('net2') expect(instances[1].name).to eq('net2')
expect(instances[1].admin_state_up).to eq('False') expect(instances[1].admin_state_up).to eq('False')
expect(instances[1].tenant_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1') expect(instances[1].project_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1')
expect(instances[1].router_external).to eq('True') expect(instances[1].router_external).to eq('True')
expect(instances[1].shared).to eq('True') expect(instances[1].shared).to eq('True')
expect(instances[1].mtu).to eq('9000') expect(instances[1].mtu).to eq('9000')

View File

@ -317,7 +317,7 @@ status="DOWN"')
expect(instances[0].subnet_name).to eq('subnet1') expect(instances[0].subnet_name).to eq('subnet1')
expect(instances[0].status).to eq('ACTIVE') expect(instances[0].status).to eq('ACTIVE')
expect(instances[0].admin_state_up).to eq('True') expect(instances[0].admin_state_up).to eq('True')
expect(instances[0].tenant_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1') expect(instances[0].project_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1')
expect(instances[1].id).to eq('c880affb-b15e-4632-b5e7-3adba6e3ab35') expect(instances[1].id).to eq('c880affb-b15e-4632-b5e7-3adba6e3ab35')
expect(instances[1].name).to eq('port2') expect(instances[1].name).to eq('port2')
@ -327,7 +327,7 @@ status="DOWN"')
expect(instances[1].subnet_name).to eq('subnet2') expect(instances[1].subnet_name).to eq('subnet2')
expect(instances[1].status).to eq('DOWN') expect(instances[1].status).to eq('DOWN')
expect(instances[1].admin_state_up).to eq('False') expect(instances[1].admin_state_up).to eq('False')
expect(instances[0].tenant_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1') expect(instances[0].project_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1')
end end
end end
end end

View File

@ -294,7 +294,7 @@ project_id="60f9544eb94c42a6b7e8e98c2be981b1"')
expect(instances[0].gateway_ip).to eq('10.0.0.1') expect(instances[0].gateway_ip).to eq('10.0.0.1')
expect(instances[0].allocation_pools).to eq(['start=10.0.0.2,end=10.0.0.254']) expect(instances[0].allocation_pools).to eq(['start=10.0.0.2,end=10.0.0.254'])
expect(instances[0].enable_dhcp).to eq('True') expect(instances[0].enable_dhcp).to eq('True')
expect(instances[0].tenant_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1') expect(instances[0].project_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1')
expect(instances[1].id).to eq('0da7a631-0f8f-4e51-8b1c-7a29d0d4f7b5') expect(instances[1].id).to eq('0da7a631-0f8f-4e51-8b1c-7a29d0d4f7b5')
expect(instances[1].name).to eq('subnet2') expect(instances[1].name).to eq('subnet2')
@ -305,7 +305,7 @@ project_id="60f9544eb94c42a6b7e8e98c2be981b1"')
expect(instances[1].cidr).to eq('10.0.1.0/24') expect(instances[1].cidr).to eq('10.0.1.0/24')
expect(instances[1].allocation_pools).to eq(['start=10.0.1.2,end=10.0.1.254']) expect(instances[1].allocation_pools).to eq(['start=10.0.1.2,end=10.0.1.254'])
expect(instances[1].enable_dhcp).to eq('False') expect(instances[1].enable_dhcp).to eq('False')
expect(instances[1].tenant_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1') expect(instances[1].project_id).to eq('60f9544eb94c42a6b7e8e98c2be981b1')
end end
end end
end end