From 37ce11ade95c41e884a868801e4186a207d1dcde Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Tue, 23 Oct 2018 10:06:22 +0800 Subject: [PATCH] vnc and spice keymap are deprecated vnc_keymap and keymap options has been deprecated as per rocky release notes[1], we should deprecate these in puppet-nova. [1]https://docs.openstack.org/releasenotes/nova/rocky.html Change-Id: Ia42632f4c67aeab387b98aafd9e0f89ad62eb850 Closes-Bug: #1794300 --- manifests/compute.pp | 22 +++++++++++-------- manifests/compute/spice.pp | 20 +++++++++++------ ...ate_keymap_parameter-21b89e7b5d84ee21.yaml | 6 +++++ spec/classes/nova_compute_spec.rb | 9 -------- 4 files changed, 32 insertions(+), 25 deletions(-) create mode 100644 releasenotes/notes/deprecate_keymap_parameter-21b89e7b5d84ee21.yaml diff --git a/manifests/compute.pp b/manifests/compute.pp index a78af0760..c1b8df47e 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -49,10 +49,6 @@ # (optional) The path at the end of the uri for communication with the VNC proxy server # Defaults to '/vnc_auto.html' # -# [*vnc_keymap*] -# (optional) The keymap to use with VNC (ls -alh /usr/share/qemu/keymaps to list available keymaps) -# Defaults to 'en-us' -# # [*force_config_drive*] # (optional) Whether to force the config drive to be attached to all VMs # Defaults to false @@ -181,6 +177,12 @@ # tunneled networks. # Defaults to [] # +# DEPRECATED PARAMETERS +# +# [*vnc_keymap*] +# (optional) The keymap to use with VNC (ls -alh /usr/share/qemu/keymaps to list available keymaps) +# Defaults to undef +# class nova::compute ( $enabled = true, $manage_service = true, @@ -192,7 +194,6 @@ class nova::compute ( $vncproxy_protocol = 'http', $vncproxy_port = '6080', $vncproxy_path = '/vnc_auto.html', - $vnc_keymap = 'en-us', $force_config_drive = false, $virtio_nic = false, $neutron_enabled = true, @@ -220,6 +221,8 @@ class nova::compute ( $reserved_huge_pages = $::os_service_default, $neutron_physnets_numa_nodes_mapping = {}, $neutron_tunnel_numa_nodes = [], + # DEPRECATED PARAMETERS + $vnc_keymap = undef, ) { include ::nova::deps @@ -231,6 +234,10 @@ class nova::compute ( include ::nova::pci include ::nova::compute::vgpu + if $vnc_keymap { + warning('vnc_keymap parameter is deprecated, has no effect and will be removed in the future.') + } + if ($vnc_enabled and $spice_enabled) { fail('vnc_enabled and spice_enabled is mutually exclusive') } @@ -308,14 +315,11 @@ class nova::compute ( include ::nova::vncproxy::common nova_config { - 'vnc/vncserver_proxyclient_address': value => - $vncserver_proxyclient_address; - 'vnc/keymap': value => $vnc_keymap; + 'vnc/vncserver_proxyclient_address': value => $vncserver_proxyclient_address; } } else { nova_config { 'vnc/vncserver_proxyclient_address': ensure => absent; - 'vnc/keymap': ensure => absent; } } diff --git a/manifests/compute/spice.pp b/manifests/compute/spice.pp index 892465aa3..dac402389 100644 --- a/manifests/compute/spice.pp +++ b/manifests/compute/spice.pp @@ -17,10 +17,6 @@ # listen on the compute host. # Defaults to '127.0.0.1' # -# [*keymap*] -# (optional) keymap for spice -# Defaults to 'en-us' -# # [*proxy_host*] # (optional) Host for the html5 console proxy # Defaults to false @@ -37,19 +33,30 @@ # (optional) Path of the spice html file for the html5 console proxy # Defaults to '/spice_auto.html' # +# DEPRECATED PARAMETERS +# +# [*keymap*] +# (optional) keymap for spice +# Defaults to undef +# class nova::compute::spice( $agent_enabled = true, $server_listen = undef, $server_proxyclient_address = '127.0.0.1', - $keymap = 'en-us', $proxy_host = false, $proxy_protocol = 'http', $proxy_port = '6082', - $proxy_path = '/spice_auto.html' + $proxy_path = '/spice_auto.html', + # DEPRECATED PARAMETERS + $keymap = undef, ) { include ::nova::deps + if $keymap { + warning('keymap parameter is deprecated, has no effect and will be removed in the future.') + } + if $proxy_host { $html5proxy_base_url = "${proxy_protocol}://${proxy_host}:${proxy_port}${proxy_path}" nova_config { @@ -61,6 +68,5 @@ class nova::compute::spice( 'spice/agent_enabled': value => $agent_enabled; 'spice/server_listen': value => $server_listen; 'spice/server_proxyclient_address': value => $server_proxyclient_address; - 'spice/keymap': value => $keymap; } } diff --git a/releasenotes/notes/deprecate_keymap_parameter-21b89e7b5d84ee21.yaml b/releasenotes/notes/deprecate_keymap_parameter-21b89e7b5d84ee21.yaml new file mode 100644 index 000000000..8921a7da1 --- /dev/null +++ b/releasenotes/notes/deprecate_keymap_parameter-21b89e7b5d84ee21.yaml @@ -0,0 +1,6 @@ +--- +deprecations: + - nova::compute::vnc_keymap option isnow deprecated for removal, the + parameter has no effect. + - nova::compute::spice::keymap option is now deprecated for removal, + the parameter has no effect. diff --git a/spec/classes/nova_compute_spec.rb b/spec/classes/nova_compute_spec.rb index 80ce89def..1a50591b2 100644 --- a/spec/classes/nova_compute_spec.rb +++ b/spec/classes/nova_compute_spec.rb @@ -122,7 +122,6 @@ describe 'nova::compute' do it 'configures vnc in nova.conf' do is_expected.to contain_nova_config('vnc/enabled').with_value(true) is_expected.to contain_nova_config('vnc/vncserver_proxyclient_address').with_value('127.0.0.1') - is_expected.to contain_nova_config('vnc/keymap').with_value('en-us') is_expected.to contain_nova_config('vnc/novncproxy_base_url').with_value( 'http://127.0.0.1:6080/vnc_auto.html' ) @@ -266,7 +265,6 @@ describe 'nova::compute' do it 'disables vnc in nova.conf' do is_expected.to contain_nova_config('vnc/enabled').with_value(false) is_expected.to contain_nova_config('vnc/vncserver_proxyclient_address').with_ensure('absent') - is_expected.to contain_nova_config('vnc/keymap').with_ensure('absent') is_expected.to_not contain_nova_config('vnc/novncproxy_base_url') end @@ -331,13 +329,6 @@ describe 'nova::compute' do it { is_expected.to contain_nova_config('DEFAULT/instance_usage_audit_period').with_value('year') } end - context 'with vnc_keymap set to fr' do - let :params do - { :vnc_keymap => 'fr', } - end - - it { is_expected.to contain_nova_config('vnc/keymap').with_value('fr') } - end end on_supported_os({