From 95699cf7d62dbc9b38e8a9da61818fc5c4d36cc7 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 10 Jul 2024 22:29:07 +0900 Subject: [PATCH] Deprecate support for monkey_patch options ... because these were deprecated in Queens release, and were already removed from nova[1]. [1] 9f48aee9b0ea68f7c8eba6a1f3d076e4194d804d Change-Id: I843b6d79fdf4fb0218a06327c9f6346aa9abd554 --- manifests/patch/config.pp | 10 +++++++--- .../deprecate-monkey_patch-8938ba80e7f2a339.yaml | 6 ++++++ spec/classes/nova_patch_config_spec.rb | 15 ++------------- 3 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 releasenotes/notes/deprecate-monkey_patch-8938ba80e7f2a339.yaml diff --git a/manifests/patch/config.pp b/manifests/patch/config.pp index d4074afb7..848b52239 100644 --- a/manifests/patch/config.pp +++ b/manifests/patch/config.pp @@ -1,24 +1,28 @@ # == Class: nova:patch::config # +# DEPRECATED !!! # This class is aim to configure nova.patch parameters # # === Parameters: # # [*monkey_patch*] # (optional) Apply monkey patching or not -# Defaults to false +# Defaults to $facts['os_service_default'] # # [*monkey_patch_modules*] # (optional) List of modules/decorators to monkey patch # Defaults to $facts['os_service_default'] # class nova::patch::config ( - $monkey_patch = false, - $monkey_patch_modules = $facts['os_service_default'], + $monkey_patch = $facts['os_service_default'], + $monkey_patch_modules = $facts['os_service_default'], ) { include nova::deps + warning("The nova::patch::config class has been deprecated \" +and will be removed in the future release.") + $monkey_patch_modules_real = pick(join(any2array($monkey_patch_modules), ','), $facts['os_service_default']) nova_config { diff --git a/releasenotes/notes/deprecate-monkey_patch-8938ba80e7f2a339.yaml b/releasenotes/notes/deprecate-monkey_patch-8938ba80e7f2a339.yaml new file mode 100644 index 000000000..79d5057f1 --- /dev/null +++ b/releasenotes/notes/deprecate-monkey_patch-8938ba80e7f2a339.yaml @@ -0,0 +1,6 @@ +--- +deprecations: + - | + The ``nova::patch::config`` class has been deprecated, because the options + supported by the class have already been removed from nova. The class + will be removed in a future release. diff --git a/spec/classes/nova_patch_config_spec.rb b/spec/classes/nova_patch_config_spec.rb index a5172e126..44d4a9e8b 100644 --- a/spec/classes/nova_patch_config_spec.rb +++ b/spec/classes/nova_patch_config_spec.rb @@ -11,8 +11,8 @@ describe 'nova::patch::config' do it { is_expected.to contain_class('nova::deps') } context 'with default parameters' do - it { is_expected.to contain_nova_config('DEFAULT/monkey_patch').with_value('false') } - it { is_expected.to contain_nova_config('DEFAULT/monkey_patch_modules').with(:value => '') } + it { is_expected.to contain_nova_config('DEFAULT/monkey_patch').with_value('') } + it { is_expected.to contain_nova_config('DEFAULT/monkey_patch_modules').with_value('') } end context 'when overriding parameters' do @@ -25,17 +25,6 @@ describe 'nova::patch::config' do it { is_expected.to contain_nova_config('DEFAULT/monkey_patch').with_value('true') } it { is_expected.to contain_nova_config('DEFAULT/monkey_patch_modules').with_value('nova.compute.api:nova.notifications.notify_decorator') } end - - context 'when overriding parameters with reset values' do - let :params do - { :monkey_patch => false, - :monkey_patch_modules => '' - } - end - - it { is_expected.to contain_nova_config('DEFAULT/monkey_patch').with_value('false') } - it { is_expected.to contain_nova_config('DEFAULT/monkey_patch_modules').with(:value => '') } - end end on_supported_os({