neutron: Avoid hard-coding defaults

This change replaces redundant defaults in nova::neutron, which define
the exact same values as service defaults, by $::os_service_default, to
reduce effort to maintain the implementations to keep them consistent
with any update in nova itself.

Change-Id: Ia01c936611a846399f19b1b0425e5ab4ff18a9e1
This commit is contained in:
Takashi Kajinami
2021-11-15 19:20:30 +09:00
parent 983374fbee
commit e25e7a6bcc
2 changed files with 19 additions and 19 deletions

View File

@@ -70,27 +70,27 @@
# #
# [*ovs_bridge*] # [*ovs_bridge*]
# (optional) Name of Integration Bridge used by Open vSwitch # (optional) Name of Integration Bridge used by Open vSwitch
# Defaults to 'br-int' # Defaults to $::os_service_default
# #
# [*extension_sync_interval*] # [*extension_sync_interval*]
# (optional) Number of seconds before querying neutron for extensions # (optional) Number of seconds before querying neutron for extensions
# Defaults to '600' # Defaults to $::os_service_default
# #
# [*vif_plugging_is_fatal*] # [*vif_plugging_is_fatal*]
# (optional) Fail to boot instance if vif plugging fails. # (optional) Fail to boot instance if vif plugging fails.
# This prevents nova from booting an instance if vif plugging notification # This prevents nova from booting an instance if vif plugging notification
# is not received from neutron. # is not received from neutron.
# Defaults to 'True' # Defaults to $::os_service_default
# #
# [*vif_plugging_timeout*] # [*vif_plugging_timeout*]
# (optional) Number of seconds to wait for neutron vif plugging events. # (optional) Number of seconds to wait for neutron vif plugging events.
# Set to '0' and vif_plugging_is_fatal to 'False' if vif plugging # Set to '0' and vif_plugging_is_fatal to 'False' if vif plugging
# notification is not being used. # notification is not being used.
# Defaults to '300' # Defaults to $::os_service_default
# #
# [*default_floating_pool*] # [*default_floating_pool*]
# (optional) Default pool for floating IPs # (optional) Default pool for floating IPs
# Defaults to 'nova' # Defaults to $::os_service_default
# #
class nova::network::neutron ( class nova::network::neutron (
$password, $password,
@@ -107,11 +107,11 @@ class nova::network::neutron (
$region_name = 'RegionOne', $region_name = 'RegionOne',
$http_retries = $::os_service_default, $http_retries = $::os_service_default,
$service_type = $::os_service_default, $service_type = $::os_service_default,
$ovs_bridge = 'br-int', $ovs_bridge = $::os_service_default,
$extension_sync_interval = '600', $extension_sync_interval = $::os_service_default,
$vif_plugging_is_fatal = true, $vif_plugging_is_fatal = $::os_service_default,
$vif_plugging_timeout = '300', $vif_plugging_timeout = $::os_service_default,
$default_floating_pool = 'nova', $default_floating_pool = $::os_service_default,
) { ) {
include nova::deps include nova::deps

View File

@@ -16,11 +16,11 @@ describe 'nova::network::neutron' do
:endpoint_override => '<SERVICE DEFAULT>', :endpoint_override => '<SERVICE DEFAULT>',
:http_retries => '<SERVICE DEFAULT>', :http_retries => '<SERVICE DEFAULT>',
:service_type => '<SERVICE DEFAULT>', :service_type => '<SERVICE DEFAULT>',
:ovs_bridge => 'br-int', :ovs_bridge => '<SERVICE DEFAULT>',
:extension_sync_interval => '600', :extension_sync_interval => '<SERVICE DEFAULT>',
:vif_plugging_is_fatal => true, :vif_plugging_is_fatal => '<SERVICE DEFAULT>',
:vif_plugging_timeout => '300', :vif_plugging_timeout => '<SERVICE DEFAULT>',
:default_floating_pool => 'nova', :default_floating_pool => '<SERVICE DEFAULT>',
} }
end end
@@ -73,10 +73,10 @@ describe 'nova::network::neutron' do
:http_retries => 3, :http_retries => 3,
:service_type => 'network', :service_type => 'network',
:ovs_bridge => 'br-int', :ovs_bridge => 'br-int',
:extension_sync_interval => '600', :extension_sync_interval => 600,
:vif_plugging_is_fatal => false, :vif_plugging_is_fatal => true,
:vif_plugging_timeout => '0', :vif_plugging_timeout => 300,
:default_floating_pool => 'public' :default_floating_pool => 'nova'
) )
end end