Remove support for monolithic cisco plugin

... because it was deprecated during Wallaby cycle[1].

[1] bc50622a2d

Change-Id: I5425f744c70c9a320adb36c0f5a112815bbffcfd
This commit is contained in:
Takashi Kajinami 2021-09-11 22:10:29 +09:00
parent 32d05ebb36
commit 4706298d29
23 changed files with 5 additions and 857 deletions

View File

@ -1,15 +0,0 @@
Puppet::Type.type(:neutron_plugin_cisco).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/neutron/plugins/cisco/cisco_plugins.ini'
end
# added for backwards compatibility with older versions of inifile
def file_path
self.class.file_path
end
end

View File

@ -1,15 +0,0 @@
Puppet::Type.type(:neutron_plugin_cisco_credentials).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/neutron/plugins/cisco/credentials.ini'
end
# added for backwards compatibility with older versions of inifile
def file_path
self.class.file_path
end
end

View File

@ -1,15 +0,0 @@
Puppet::Type.type(:neutron_plugin_cisco_db_conn).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/neutron/plugins/cisco/db_conn.ini'
end
# added for backwards compatibility with older versions of inifile
def file_path
self.class.file_path
end
end

View File

@ -1,15 +0,0 @@
Puppet::Type.type(:neutron_plugin_cisco_l2network).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/neutron/plugins/cisco/l2network_plugin.ini'
end
# added for backwards compatibility with older versions of inifile
def file_path
self.class.file_path
end
end

View File

@ -1,56 +0,0 @@
Puppet::Type.newtype(:neutron_plugin_cisco) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from cisco_plugins.ini'
newvalues(/\S+\/\S+/)
end
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |value|
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
def is_to_s( currentvalue )
if resource.secret?
return '[old secret redacted]'
else
return currentvalue
end
end
def should_to_s( newvalue )
if resource.secret?
return '[new secret redacted]'
else
return newvalue
end
end
end
newparam(:secret, :boolean => true) do
desc 'Whether to hide the value from Puppet logs. Defaults to `false`.'
newvalues(:true, :false)
defaultto false
end
newparam(:ensure_absent_val) do
desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
defaultto('<SERVICE DEFAULT>')
end
autorequire(:file) do
['/etc/neutron/plugins/cisco']
end
autorequire(:anchor) do
['neutron::install::end']
end
end

View File

@ -1,57 +0,0 @@
Puppet::Type.newtype(:neutron_plugin_cisco_credentials) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from credentials.ini'
newvalues(/\S+\/\S+/)
end
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |value|
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
def is_to_s( currentvalue )
if resource.secret?
return '[old secret redacted]'
else
return currentvalue
end
end
def should_to_s( newvalue )
if resource.secret?
return '[new secret redacted]'
else
return newvalue
end
end
end
newparam(:secret, :boolean => true) do
desc 'Whether to hide the value from Puppet logs. Defaults to `false`.'
newvalues(:true, :false)
defaultto false
end
newparam(:ensure_absent_val) do
desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
defaultto('<SERVICE DEFAULT>')
end
autorequire(:file) do
['/etc/neutron/plugins/cisco']
end
autorequire(:anchor) do
['neutron::install::end']
end
end

View File

@ -1,32 +0,0 @@
Puppet::Type.newtype(:neutron_plugin_cisco_db_conn) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from plugins/cisco/db_conn.ini'
newvalues(/\S+\/\S+/)
end
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |value|
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
end
newparam(:ensure_absent_val) do
desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
defaultto('<SERVICE DEFAULT>')
end
autorequire(:file) do
['/etc/neutron/plugins/cisco']
end
autorequire(:anchor) do
['neutron::install::end']
end
end

View File

@ -1,32 +0,0 @@
Puppet::Type.newtype(:neutron_plugin_cisco_l2network) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from plugins/cisco/l2network_plugin.ini'
newvalues(/\S+\/\S+/)
end
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |value|
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
end
newparam(:ensure_absent_val) do
desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
defaultto('<SERVICE DEFAULT>')
end
autorequire(:file) do
['/etc/neutron/plugins/cisco']
end
autorequire(:anchor) do
['neutron::install::end']
end
end

View File

@ -92,15 +92,6 @@
# [*api_config*]
# (optional) Manage configuration of api-paste.ini
#
# [*plugin_cisco_db_conn_config*]
# (optional) Manage configuration of plugins/cisco/db_conn.ini
#
# [*plugin_cisco_l2network_config*]
# (optional) Manage configuration of plugins/cisco/l2network_plugin.ini
#
# [*plugin_cisco_config*]
# (optional) Manage configuration of cisco_plugins.ini
#
# [*plugin_plumgrid_config*]
# (optional) Manage configuration of plugins/plumgrid/plumgrid.ini
#
@ -135,9 +126,6 @@ class neutron::config (
$plugin_nvp_config = {},
# DEPRECATED PARAMETERS
$api_config = undef,
$plugin_cisco_db_conn_config = undef,
$plugin_cisco_l2network_config = undef,
$plugin_cisco_config = undef,
$plugin_plumgrid_config = undef,
$plugin_midonet_config = undef,
) {
@ -156,18 +144,6 @@ will be removed in a future release. Use the api_paste_ini parameter instead.')
$api_paste_ini_real = $api_paste_ini
}
$cisco_plugin_param_names = [
'plugin_cisco_db_conn_config',
'plugin_cisco_l2network_config',
'plugin_cisco_config',
]
$cisco_plugin_param_names.each |$param_name| {
$param = getvar($param_name)
if $param != undef{
warning("The ${param_name} parameter is deprecated and has no effect.")
}
}
if $plugin_midonet_config != undef {
warning('The plugin_midonet_config parameter has been deprecated and has no effect')
}

View File

@ -49,10 +49,6 @@ class neutron::deps {
Anchor['neutron::config::begin'] -> Neutron_metadata_agent_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_metering_agent_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_bgp_dragent_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_cisco_credentials<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_cisco_db_conn<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_cisco<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_cisco_l2network<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_linuxbridge<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_l2gw_service_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_ml2<||> ~> Anchor['neutron::config::end']

View File

@ -24,7 +24,7 @@
# [*core_plugin*]
# (optional) Neutron plugin provider
# Defaults to ml2
# Could be bigswitch, brocade, cisco, embrane, hyperv, midonet,
# Could be bigswitch, brocade, embrane, hyperv, midonet,
# ml2, mlnx, nec, nicira, ryu, nuage, opencontrail, nsx
#
# Example for nuage:

View File

@ -9,7 +9,6 @@ class neutron::params {
$ovs_agent_service = 'neutron-openvswitch-agent'
$destroy_patch_ports_service = 'neutron-destroy-patch-ports'
$linuxbridge_agent_service = 'neutron-linuxbridge-agent'
$cisco_config_file = '/etc/neutron/plugins/cisco/cisco_plugins.ini'
$opencontrail_plugin_package = 'neutron-plugin-contrail'
$opencontrail_config_file = '/etc/neutron/plugins/opencontrail/ContrailPlugin.ini'
$ovn_plugin_package = 'python3-networking-ovn'

View File

@ -1,125 +0,0 @@
#
# DEPRECATED !
# Configure the cisco neutron plugin
# More info available here:
# https://wiki.openstack.org/wiki/Cisco-neutron
#
# === Parameters
#
# [*database_pass*]
# The password that will be used to connect to the db
#
# [*keystone_password*]
# The password for the supplied username
#
# [*database_name*]
# The name of the db table to use
# Defaults to neutron
#
# [*database_user*]
# The user that will be used to connect to the db
# Defaults to neutron
#
# [*database_host*]
# The address or hostname of the database
# Defaults to 127.0.0.1
#
# [*keystone_username*]
# The admin username for the plugin to use
# Defaults to neutron
#
# [*keystone_auth_url*]
# The url against which to authenticate
# Defaults to http://127.0.0.1:5000/v3/
#
# [*keystone_tenant*]
# The tenant the supplied user has admin privs in
# Defaults to services
#
# [*vswitch_plugin*]
# (optional) The openvswitch plugin to use
# Defaults to ovs_neutron_plugin.OVSNeutronPluginV2
#
# [*nexus_plugin*]
# (optional) The nexus plugin to use
# Defaults to $::os_service_default. This will not set a nexus plugin to use
# Can be set to neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin
#
# [*vlan_start*]
# (optional) First VLAN for private networks.
# Defaults to '100'.
#
# [*vlan_end*]
# (optional) Last VLAN for private networks.
# Defaults to '3000'.
#
# [*vlan_name_prefix*]
# (optional) VLAN Name prefix
# Defaults to 'q-'
#
# [*model_class*]
# (optional) Model Class
# Defaults to 'neutron.plugins.cisco.models.virt_phy_sw_v2.VirtualPhysicalSwitchModelV2'
#
# [*max_ports*]
# (optional) Number max of ports
# Defaults to '100'
#
# [*max_port_profiles*]
# (optional) Number max of port profiles
# Defaults to '65568'
#
# [*manager_class*]
# (optional) Manager Class
# Defaults to 'neutron.plugins.cisco.segmentation.l2network_vlan_mgr_v2.L2NetworkVLANMgr'
#
# [*max_networks*]
# (optional)
# Defaults to '65568'
#
# [*package_ensure*]
# (optional) the ensure state of the package resource
# Defaults to 'present'
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the cisco config.
# Defaults to false.
#
# Other parameters are currently not used by the plugin and
# can be left unchanged, but in grizzly the plugin will fail
# to launch if they are not there. The config for Havana will
# move to a single config file and this will be simplified.
class neutron::plugins::cisco(
$keystone_password,
$database_pass,
# Database connection
$database_name = 'neutron',
$database_user = 'neutron',
$database_host = '127.0.0.1',
# Keystone connection
$keystone_username = 'neutron',
$keystone_tenant = 'services',
$keystone_auth_url = 'http://127.0.0.1:5000/v3/',
$vswitch_plugin = 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
$nexus_plugin = $::os_service_default,
# Plugin minimum configuration
$vlan_start = '100',
$vlan_end = '3000',
$vlan_name_prefix = 'q-',
$model_class = 'neutron.plugins.cisco.models.virt_phy_sw_v2.VirtualPhysicalSwitchModelV2',
$max_ports = '100',
$max_port_profiles = '65568',
$manager_class = 'neutron.plugins.cisco.segmentation.l2network_vlan_mgr_v2.L2NetworkVLANMgr',
$max_networks = '65568',
$package_ensure = 'present',
$purge_config = false,
) {
warning('Support for the Neutron Cisco plugin was deprecated and has no effect')
}

View File

@ -0,0 +1,4 @@
---
upgrade:
- |
The ``neutron::plugins::cisco`` class has been removed.

View File

@ -11,10 +11,6 @@ describe 'basic neutron_config resource' do
'/etc/neutron/metering_agent.ini',
'/etc/neutron/l2gw_plugin.ini',
'/etc/neutron/l2gateway_agent.ini',
'/etc/neutron/plugins/cisco/cisco_plugins.ini',
'/etc/neutron/plugins/cisco/credentials.ini',
'/etc/neutron/plugins/cisco/db_conn.ini',
'/etc/neutron/plugins/cisco/l2network_plugin.ini',
'/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini',
'/etc/neutron/plugins/ml2/ml2_conf.ini',
'/etc/neutron/plugins/nicira/nvp.ini',
@ -36,10 +32,6 @@ describe 'basic neutron_config resource' do
File <||> -> Neutron_l3_agent_config <||>
File <||> -> Neutron_metadata_agent_config <||>
File <||> -> Neutron_metering_agent_config <||>
File <||> -> Neutron_plugin_cisco <||>
File <||> -> Neutron_plugin_cisco_credentials <||>
File <||> -> Neutron_plugin_cisco_db_conn <||>
File <||> -> Neutron_plugin_cisco_l2network <||>
File <||> -> Neutron_plugin_linuxbridge <||>
File <||> -> Neutron_plugin_ml2 <||>
File <||> -> Neutron_plugin_nvp <||>
@ -58,7 +50,6 @@ describe 'basic neutron_config resource' do
$neutron_directories = ['/etc/neutron',
'/etc/neutron/plugins',
'/etc/neutron/plugins/cisco',
'/etc/neutron/plugins/linuxbridge',
'/etc/neutron/plugins/ml2',
'/etc/neutron/plugins/nicira',
@ -75,10 +66,6 @@ describe 'basic neutron_config resource' do
'/etc/neutron/metering_agent.ini',
'/etc/neutron/l2gw_plugin.ini',
'/etc/neutron/l2gateway_agent.ini',
'/etc/neutron/plugins/cisco/cisco_plugins.ini',
'/etc/neutron/plugins/cisco/credentials.ini',
'/etc/neutron/plugins/cisco/db_conn.ini',
'/etc/neutron/plugins/cisco/l2network_plugin.ini',
'/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini',
'/etc/neutron/plugins/ml2/ml2_conf.ini',
'/etc/neutron/plugins/nicira/nvp.ini',
@ -223,78 +210,6 @@ describe 'basic neutron_config resource' do
ensure_absent_val => 'toto',
}
neutron_plugin_cisco { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
neutron_plugin_cisco { 'DEFAULT/thisshouldnotexist' :
value => '<SERVICE DEFAULT>',
}
neutron_plugin_cisco { 'DEFAULT/thisshouldexist2' :
value => '<SERVICE DEFAULT>',
ensure_absent_val => 'toto',
}
neutron_plugin_cisco { 'DEFAULT/thisshouldnotexist2' :
value => 'toto',
ensure_absent_val => 'toto',
}
neutron_plugin_cisco_credentials { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
neutron_plugin_cisco_credentials { 'DEFAULT/thisshouldnotexist' :
value => '<SERVICE DEFAULT>',
}
neutron_plugin_cisco_credentials { 'DEFAULT/thisshouldexist2' :
value => '<SERVICE DEFAULT>',
ensure_absent_val => 'toto',
}
neutron_plugin_cisco_credentials { 'DEFAULT/thisshouldnotexist2' :
value => 'toto',
ensure_absent_val => 'toto',
}
neutron_plugin_cisco_db_conn { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
neutron_plugin_cisco_db_conn { 'DEFAULT/thisshouldnotexist' :
value => '<SERVICE DEFAULT>',
}
neutron_plugin_cisco_db_conn { 'DEFAULT/thisshouldexist2' :
value => '<SERVICE DEFAULT>',
ensure_absent_val => 'toto',
}
neutron_plugin_cisco_db_conn { 'DEFAULT/thisshouldnotexist2' :
value => 'toto',
ensure_absent_val => 'toto',
}
neutron_plugin_cisco_l2network { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
neutron_plugin_cisco_l2network { 'DEFAULT/thisshouldnotexist' :
value => '<SERVICE DEFAULT>',
}
neutron_plugin_cisco_l2network { 'DEFAULT/thisshouldexist2' :
value => '<SERVICE DEFAULT>',
ensure_absent_val => 'toto',
}
neutron_plugin_cisco_l2network { 'DEFAULT/thisshouldnotexist2' :
value => 'toto',
ensure_absent_val => 'toto',
}
neutron_plugin_linuxbridge { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
@ -555,10 +470,6 @@ describe 'basic neutron_config resource' do
'neutron_fwaas_service_config',
'neutron_l3_agent_config',
'neutron_metadata_agent_config',
'neutron_plugin_cisco',
'neutron_plugin_cisco_credentials',
'neutron_plugin_cisco_db_conn',
'neutron_plugin_cisco_l2network',
'neutron_plugin_linuxbridge',
'neutron_metering_agent_config',
'neutron_plugin_ml2',

View File

@ -1,74 +0,0 @@
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'inifile',
'lib')
)
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'openstacklib',
'lib')
)
require 'spec_helper'
provider_class = Puppet::Type.type(:neutron_plugin_cisco).provider(:ini_setting)
describe provider_class do
it 'should default to the default setting when no other one is specified' do
resource = Puppet::Type::Neutron_plugin_cisco.new(
{
:name => 'DEFAULT/foo',
:value => 'bar'
}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/cisco/cisco_plugins.ini')
end
it 'should allow setting to be set explicitly' do
resource = Puppet::Type::Neutron_plugin_cisco.new(
{
:name => 'dude/foo',
:value => 'bar'
}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('dude')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/cisco/cisco_plugins.ini')
end
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
resource = Puppet::Type::Neutron_plugin_cisco.new(
{:name => 'dude/foo', :value => '<SERVICE DEFAULT>'}
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
it 'should ensure absent when value matches ensure_absent_val' do
resource = Puppet::Type::Neutron_plugin_cisco.new(
{:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' }
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
end

View File

@ -1,74 +0,0 @@
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'inifile',
'lib')
)
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'openstacklib',
'lib')
)
require 'spec_helper'
provider_class = Puppet::Type.type(:neutron_plugin_cisco_credentials).provider(:ini_setting)
describe provider_class do
it 'should default to the default setting when no other one is specified' do
resource = Puppet::Type::Neutron_plugin_cisco_credentials.new(
{
:name => 'DEFAULT/foo',
:value => 'bar'
}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/cisco/credentials.ini')
end
it 'should allow setting to be set explicitly' do
resource = Puppet::Type::Neutron_plugin_cisco_credentials.new(
{
:name => 'dude/foo',
:value => 'bar'
}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('dude')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/cisco/credentials.ini')
end
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
resource = Puppet::Type::Neutron_plugin_cisco_credentials.new(
{:name => 'dude/foo', :value => '<SERVICE DEFAULT>'}
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
it 'should ensure absent when value matches ensure_absent_val' do
resource = Puppet::Type::Neutron_plugin_cisco_credentials.new(
{:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' }
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
end

View File

@ -1,74 +0,0 @@
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'inifile',
'lib')
)
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'openstacklib',
'lib')
)
require 'spec_helper'
provider_class = Puppet::Type.type(:neutron_plugin_cisco_db_conn).provider(:ini_setting)
describe provider_class do
it 'should default to the default setting when no other one is specified' do
resource = Puppet::Type::Neutron_plugin_cisco_db_conn.new(
{
:name => 'DEFAULT/foo',
:value => 'bar'
}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/cisco/db_conn.ini')
end
it 'should allow setting to be set explicitly' do
resource = Puppet::Type::Neutron_plugin_cisco_db_conn.new(
{
:name => 'dude/foo',
:value => 'bar'
}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('dude')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/cisco/db_conn.ini')
end
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
resource = Puppet::Type::Neutron_plugin_cisco_db_conn.new(
{:name => 'dude/foo', :value => '<SERVICE DEFAULT>'}
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
it 'should ensure absent when value matches ensure_absent_val' do
resource = Puppet::Type::Neutron_plugin_cisco_db_conn.new(
{:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' }
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
end

View File

@ -1,74 +0,0 @@
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'inifile',
'lib')
)
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'openstacklib',
'lib')
)
require 'spec_helper'
provider_class = Puppet::Type.type(:neutron_plugin_cisco_l2network).provider(:ini_setting)
describe provider_class do
it 'should default to the default setting when no other one is specified' do
resource = Puppet::Type::Neutron_plugin_cisco_l2network.new(
{
:name => 'DEFAULT/foo',
:value => 'bar'
}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/cisco/l2network_plugin.ini')
end
it 'should allow setting to be set explicitly' do
resource = Puppet::Type::Neutron_plugin_cisco_l2network.new(
{
:name => 'dude/foo',
:value => 'bar'
}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('dude')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/cisco/l2network_plugin.ini')
end
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
resource = Puppet::Type::Neutron_plugin_cisco_l2network.new(
{:name => 'dude/foo', :value => '<SERVICE DEFAULT>'}
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
it 'should ensure absent when value matches ensure_absent_val' do
resource = Puppet::Type::Neutron_plugin_cisco_l2network.new(
{:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' }
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
end

View File

@ -1,20 +0,0 @@
require 'puppet'
require 'puppet/type/neutron_plugin_cisco_credentials'
describe 'Puppet::Type.type(:neutron_plugin_cisco_credentials)' do
before :each do
@neutron_plugin_cisco_credentials = Puppet::Type.type(:neutron_plugin_cisco_credentials).new(:name => 'DEFAULT/foo', :value => 'bar')
end
it 'should autorequire the package that install the file' do
catalog = Puppet::Resource::Catalog.new
anchor = Puppet::Type.type(:anchor).new(:name => 'neutron::install::end')
catalog.add_resource anchor, @neutron_plugin_cisco_credentials
dependency = @neutron_plugin_cisco_credentials.autorequire
expect(dependency.size).to eq(1)
expect(dependency[0].target).to eq(@neutron_plugin_cisco_credentials)
expect(dependency[0].source).to eq(anchor)
end
end

View File

@ -1,20 +0,0 @@
require 'puppet'
require 'puppet/type/neutron_plugin_cisco_db_conn'
describe 'Puppet::Type.type(:neutron_plugin_cisco_db_conn)' do
before :each do
@neutron_plugin_cisco_db_conn = Puppet::Type.type(:neutron_plugin_cisco_db_conn).new(:name => 'DEFAULT/foo', :value => 'bar')
end
it 'should autorequire the package that install the file' do
catalog = Puppet::Resource::Catalog.new
anchor = Puppet::Type.type(:anchor).new(:name => 'neutron::install::end')
catalog.add_resource anchor, @neutron_plugin_cisco_db_conn
dependency = @neutron_plugin_cisco_db_conn.autorequire
expect(dependency.size).to eq(1)
expect(dependency[0].target).to eq(@neutron_plugin_cisco_db_conn)
expect(dependency[0].source).to eq(anchor)
end
end

View File

@ -1,20 +0,0 @@
require 'puppet'
require 'puppet/type/neutron_plugin_cisco_l2network'
describe 'Puppet::Type.type(:neutron_plugin_cisco_l2network)' do
before :each do
@neutron_plugin_cisco_l2network = Puppet::Type.type(:neutron_plugin_cisco_l2network).new(:name => 'DEFAULT/foo', :value => 'bar')
end
it 'should autorequire the package that install the file' do
catalog = Puppet::Resource::Catalog.new
anchor = Puppet::Type.type(:anchor).new(:name => 'neutron::install::end')
catalog.add_resource anchor, @neutron_plugin_cisco_l2network
dependency = @neutron_plugin_cisco_l2network.autorequire
expect(dependency.size).to eq(1)
expect(dependency[0].target).to eq(@neutron_plugin_cisco_l2network)
expect(dependency[0].source).to eq(anchor)
end
end

View File

@ -1,20 +0,0 @@
require 'puppet'
require 'puppet/type/neutron_plugin_cisco'
describe 'Puppet::Type.type(:nova_plugin_cisco)' do
before :each do
@neutron_plugin_cisco = Puppet::Type.type(:neutron_plugin_cisco).new(:name => 'DEFAULT/foo', :value => 'bar')
end
it 'should autorequire the package that install the file' do
catalog = Puppet::Resource::Catalog.new
anchor = Puppet::Type.type(:anchor).new(:name => 'neutron::install::end')
catalog.add_resource anchor, @neutron_plugin_cisco
dependency = @neutron_plugin_cisco.autorequire
expect(dependency.size).to eq(1)
expect(dependency[0].target).to eq(@neutron_plugin_cisco)
expect(dependency[0].source).to eq(anchor)
end
end