vmware: Avoid hard-coding default values
... but use the service default values globally. The service defaults are usually considered to be the reasonable base. Change-Id: I095b0b383f4db3f2656dcea55cced262149937d0
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
# [*api_retry_count*]
|
# [*api_retry_count*]
|
||||||
# (optional) The number of times we retry on failures,
|
# (optional) The number of times we retry on failures,
|
||||||
# e.g., socket error, etc.
|
# e.g., socket error, etc.
|
||||||
# Defaults to 5.
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*maximum_objects*]
|
# [*maximum_objects*]
|
||||||
# (optional) The maximum number of ObjectContent data objects that should
|
# (optional) The maximum number of ObjectContent data objects that should
|
||||||
@@ -28,15 +28,15 @@
|
|||||||
# objects reaches the specified maximum. The server may still
|
# objects reaches the specified maximum. The server may still
|
||||||
# limit the count to something less than the configured value.
|
# limit the count to something less than the configured value.
|
||||||
# Any remaining objects may be retrieved with additional requests.
|
# Any remaining objects may be retrieved with additional requests.
|
||||||
# Defaults to 100.
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*task_poll_interval*]
|
# [*task_poll_interval*]
|
||||||
# (optional) The interval in seconds used for polling of remote tasks.
|
# (optional) The interval in seconds used for polling of remote tasks.
|
||||||
# Defaults to 5.0
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*use_linked_clone*]
|
# [*use_linked_clone*]
|
||||||
# (optional) Whether to use linked clone strategy while creating VM's.
|
# (optional) Whether to use linked clone strategy while creating VM's.
|
||||||
# Defaults to true.
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*compute_driver*]
|
# [*compute_driver*]
|
||||||
# (optional) Compute driver.
|
# (optional) Compute driver.
|
||||||
@@ -63,10 +63,10 @@ class nova::compute::vmware(
|
|||||||
$host_username,
|
$host_username,
|
||||||
$host_password,
|
$host_password,
|
||||||
$cluster_name,
|
$cluster_name,
|
||||||
$api_retry_count = 5,
|
$api_retry_count = $::os_service_default,
|
||||||
$maximum_objects = 100,
|
$maximum_objects = $::os_service_default,
|
||||||
$task_poll_interval = 5.0,
|
$task_poll_interval = $::os_service_default,
|
||||||
$use_linked_clone = true,
|
$use_linked_clone = $::os_service_default,
|
||||||
$compute_driver = 'vmwareapi.VMwareVCDriver',
|
$compute_driver = 'vmwareapi.VMwareVCDriver',
|
||||||
$insecure = $::os_service_default,
|
$insecure = $::os_service_default,
|
||||||
$ca_file = $::os_service_default,
|
$ca_file = $::os_service_default,
|
||||||
|
12
releasenotes/notes/vmware-default-410fffde49744341.yaml
Normal file
12
releasenotes/notes/vmware-default-410fffde49744341.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
Default values of the ``nova::compute::vmware`` class parameters have been
|
||||||
|
updated to use service defaults more globally. Because of this change,
|
||||||
|
the following parameters use effectively different default values.
|
||||||
|
|
||||||
|
- ``api_retry_count`` is changed from ``5`` to the service
|
||||||
|
default value (``10``)
|
||||||
|
|
||||||
|
- ``task_poll_interval`` is changed from ``5.0`` to the service default
|
||||||
|
value (``0.5``)
|
@@ -3,20 +3,24 @@ require 'spec_helper'
|
|||||||
describe 'nova::compute::vmware' do
|
describe 'nova::compute::vmware' do
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{:host_ip => '127.0.0.1',
|
{
|
||||||
:host_username => 'root',
|
:host_ip => '127.0.0.1',
|
||||||
:host_password => 'passw0rd',
|
:host_username => 'root',
|
||||||
:cluster_name => 'cluster1'}
|
:host_password => 'passw0rd',
|
||||||
|
:cluster_name => 'cluster1'
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
let :optional_params do
|
let :optional_params do
|
||||||
{:api_retry_count => 10,
|
{
|
||||||
:maximum_objects => 100,
|
:api_retry_count => 10,
|
||||||
:task_poll_interval => 10.5,
|
:maximum_objects => 100,
|
||||||
:use_linked_clone => false,
|
:task_poll_interval => 10.5,
|
||||||
:compute_driver => 'vmwareapi.FoobarDriver',
|
:use_linked_clone => false,
|
||||||
:insecure => true,
|
:compute_driver => 'vmwareapi.FoobarDriver',
|
||||||
:datastore_regex => '/(?:[^:]|:[^:])+/' }
|
:insecure => true,
|
||||||
|
:datastore_regex => '/(?:[^:]|:[^:])+/'
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for 'vmware api' do
|
shared_examples_for 'vmware api' do
|
||||||
@@ -28,19 +32,19 @@ describe 'nova::compute::vmware' do
|
|||||||
is_expected.to contain_nova_config('vmware/host_username').with_value(params[:host_username])
|
is_expected.to contain_nova_config('vmware/host_username').with_value(params[:host_username])
|
||||||
is_expected.to contain_nova_config('vmware/host_password').with_value(params[:host_password]).with_secret(true)
|
is_expected.to contain_nova_config('vmware/host_password').with_value(params[:host_password]).with_secret(true)
|
||||||
is_expected.to contain_nova_config('vmware/cluster_name').with_value(params[:cluster_name])
|
is_expected.to contain_nova_config('vmware/cluster_name').with_value(params[:cluster_name])
|
||||||
is_expected.to contain_nova_config('vmware/api_retry_count').with_value(5)
|
is_expected.to contain_nova_config('vmware/api_retry_count').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_nova_config('vmware/maximum_objects').with_value(100)
|
is_expected.to contain_nova_config('vmware/maximum_objects').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_nova_config('vmware/task_poll_interval').with_value(5.0)
|
is_expected.to contain_nova_config('vmware/task_poll_interval').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_nova_config('vmware/use_linked_clone').with_value(true)
|
is_expected.to contain_nova_config('vmware/use_linked_clone').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_nova_config('vmware/insecure').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_nova_config('vmware/insecure').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_nova_config('vmware/ca_file').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_nova_config('vmware/ca_file').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_nova_config('vmware/datastore_regex').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_nova_config('vmware/datastore_regex').with_value('<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'installs suds python package' do
|
it 'installs suds python package' do
|
||||||
is_expected.to contain_package('python-suds').with(
|
is_expected.to contain_package('python-suds').with(
|
||||||
:ensure => 'present'
|
:ensure => 'present'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -55,7 +59,7 @@ describe 'nova::compute::vmware' do
|
|||||||
is_expected.to contain_nova_config('vmware/api_retry_count').with_value(params[:api_retry_count])
|
is_expected.to contain_nova_config('vmware/api_retry_count').with_value(params[:api_retry_count])
|
||||||
is_expected.to contain_nova_config('vmware/maximum_objects').with_value(params[:maximum_objects])
|
is_expected.to contain_nova_config('vmware/maximum_objects').with_value(params[:maximum_objects])
|
||||||
is_expected.to contain_nova_config('vmware/task_poll_interval').with_value(params[:task_poll_interval])
|
is_expected.to contain_nova_config('vmware/task_poll_interval').with_value(params[:task_poll_interval])
|
||||||
is_expected.to contain_nova_config('vmware/use_linked_clone').with_value(false)
|
is_expected.to contain_nova_config('vmware/use_linked_clone').with_value(params[:use_linked_clone])
|
||||||
is_expected.to contain_nova_config('vmware/insecure').with_value(params[:insecure])
|
is_expected.to contain_nova_config('vmware/insecure').with_value(params[:insecure])
|
||||||
is_expected.to contain_nova_config('vmware/datastore_regex').with_value(params[:datastore_regex])
|
is_expected.to contain_nova_config('vmware/datastore_regex').with_value(params[:datastore_regex])
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user