diff --git a/manifests/api.pp b/manifests/api.pp index 95949aad..3988a54c 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -39,10 +39,6 @@ # without specifying a type. # Defaults to $::os_service_default. # -# [*validate*] -# (optional) Whether to validate the service is working after any service refreshes -# Defaults to false -# # [*sync_db*] # (Optional) Run db sync on the node. # Defaults to true @@ -117,6 +113,11 @@ # requests. For example, boot-from-volume. # Defaults to undef # +# [*validate*] +# (optional) Whether to validate the service is working after any service +# refreshes +# Defaults to undef +# class cinder::api ( $service_workers = $::os_workers, $package_ensure = 'present', @@ -127,7 +128,6 @@ class cinder::api ( $default_volume_type = $::os_service_default, $ratelimits_factory = 'cinder.api.v2.limits:RateLimitingMiddleware.factory', - $validate = false, $sync_db = true, $public_endpoint = $::os_service_default, $osapi_volume_base_url = $::os_service_default, @@ -143,7 +143,8 @@ class cinder::api ( $osapi_volume_listen_port = $::os_service_default, $use_forwarded_for = $::os_service_default, # DEPRECATED PARAMETERS - $os_region_name = undef + $os_region_name = undef, + $validate = undef, ) inherits cinder::params { include cinder::deps @@ -155,6 +156,10 @@ class cinder::api ( Use cinder::nova::region_name instead') } + if $validate != undef { + warning('The cinder::api::validate parameter is deprecated and has no effect') + } + validate_legacy(Boolean, 'validate_bool', $manage_service) validate_legacy(Boolean, 'validate_bool', $enabled) @@ -250,20 +255,4 @@ running as a standalone service, or httpd for being run by a httpd server") 'filter:ratelimit/limits': value => $ratelimits; } } - - if $validate { - $keystone_project_name = $::cinder::keystone::authtoken::project_name - $keystone_username = $::cinder::keystone::authtoken::username - $keystone_password = $::cinder::keystone::authtoken::password - - $validation_cmd = { - 'cinder-api' => { - # lint:ignore:140chars - 'command' => "cinder --os-auth-url ${::cinder::keystone::authtoken::www_authenticate_uri} --os-project-name ${keystone_project_name} --os-username ${keystone_username} --os-password ${keystone_password} list", - # lint:endignore - } - } - create_resources('openstacklib::service_validation', $validation_cmd, {'subscribe' => 'Anchor[cinder::service::end]'}) - } - } diff --git a/releasenotes/notes/deprecate-service-validation-f30611c72f3a484d.yaml b/releasenotes/notes/deprecate-service-validation-f30611c72f3a484d.yaml new file mode 100644 index 00000000..67038c45 --- /dev/null +++ b/releasenotes/notes/deprecate-service-validation-f30611c72f3a484d.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + The service validation feature of the ``cinder::api`` class is deprecated, + and the ``cinder::api::validate`` parameter has no effect now. diff --git a/spec/classes/cinder_api_spec.rb b/spec/classes/cinder_api_spec.rb index dd414ddd..8bb51d64 100644 --- a/spec/classes/cinder_api_spec.rb +++ b/spec/classes/cinder_api_spec.rb @@ -118,18 +118,6 @@ describe 'cinder::api' do )} end - context 'while validating the service with default command' do - let :params do - req_params.merge({ - :validate => true, - }) - end - it { is_expected.to contain_openstacklib__service_validation('cinder-api').with( - :command => 'cinder --os-auth-url http://localhost:5000 --os-project-name services --os-username cinder --os-password foo list', - :subscribe => 'Anchor[cinder::service::end]', - )} - end - context 'with a custom auth_strategy' do let :params do req_params.merge({'auth_strategy' => 'noauth'})