Merge "vnc and spice keymap are deprecated"

This commit is contained in:
Zuul 2018-10-29 04:39:25 +00:00 committed by Gerrit Code Review
commit 12d59ac874
4 changed files with 32 additions and 25 deletions

View File

@ -49,10 +49,6 @@
# (optional) The path at the end of the uri for communication with the VNC proxy server # (optional) The path at the end of the uri for communication with the VNC proxy server
# Defaults to '/vnc_auto.html' # 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*] # [*force_config_drive*]
# (optional) Whether to force the config drive to be attached to all VMs # (optional) Whether to force the config drive to be attached to all VMs
# Defaults to false # Defaults to false
@ -181,6 +177,12 @@
# tunneled networks. # tunneled networks.
# Defaults to [] # 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 ( class nova::compute (
$enabled = true, $enabled = true,
$manage_service = true, $manage_service = true,
@ -192,7 +194,6 @@ class nova::compute (
$vncproxy_protocol = 'http', $vncproxy_protocol = 'http',
$vncproxy_port = '6080', $vncproxy_port = '6080',
$vncproxy_path = '/vnc_auto.html', $vncproxy_path = '/vnc_auto.html',
$vnc_keymap = 'en-us',
$force_config_drive = false, $force_config_drive = false,
$virtio_nic = false, $virtio_nic = false,
$neutron_enabled = true, $neutron_enabled = true,
@ -220,6 +221,8 @@ class nova::compute (
$reserved_huge_pages = $::os_service_default, $reserved_huge_pages = $::os_service_default,
$neutron_physnets_numa_nodes_mapping = {}, $neutron_physnets_numa_nodes_mapping = {},
$neutron_tunnel_numa_nodes = [], $neutron_tunnel_numa_nodes = [],
# DEPRECATED PARAMETERS
$vnc_keymap = undef,
) { ) {
include ::nova::deps include ::nova::deps
@ -231,6 +234,10 @@ class nova::compute (
include ::nova::pci include ::nova::pci
include ::nova::compute::vgpu 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) { if ($vnc_enabled and $spice_enabled) {
fail('vnc_enabled and spice_enabled is mutually exclusive') fail('vnc_enabled and spice_enabled is mutually exclusive')
} }
@ -308,14 +315,11 @@ class nova::compute (
include ::nova::vncproxy::common include ::nova::vncproxy::common
nova_config { nova_config {
'vnc/vncserver_proxyclient_address': value => 'vnc/vncserver_proxyclient_address': value => $vncserver_proxyclient_address;
$vncserver_proxyclient_address;
'vnc/keymap': value => $vnc_keymap;
} }
} else { } else {
nova_config { nova_config {
'vnc/vncserver_proxyclient_address': ensure => absent; 'vnc/vncserver_proxyclient_address': ensure => absent;
'vnc/keymap': ensure => absent;
} }
} }

View File

@ -17,10 +17,6 @@
# listen on the compute host. # listen on the compute host.
# Defaults to '127.0.0.1' # Defaults to '127.0.0.1'
# #
# [*keymap*]
# (optional) keymap for spice
# Defaults to 'en-us'
#
# [*proxy_host*] # [*proxy_host*]
# (optional) Host for the html5 console proxy # (optional) Host for the html5 console proxy
# Defaults to false # Defaults to false
@ -37,19 +33,30 @@
# (optional) Path of the spice html file for the html5 console proxy # (optional) Path of the spice html file for the html5 console proxy
# Defaults to '/spice_auto.html' # Defaults to '/spice_auto.html'
# #
# DEPRECATED PARAMETERS
#
# [*keymap*]
# (optional) keymap for spice
# Defaults to undef
#
class nova::compute::spice( class nova::compute::spice(
$agent_enabled = true, $agent_enabled = true,
$server_listen = undef, $server_listen = undef,
$server_proxyclient_address = '127.0.0.1', $server_proxyclient_address = '127.0.0.1',
$keymap = 'en-us',
$proxy_host = false, $proxy_host = false,
$proxy_protocol = 'http', $proxy_protocol = 'http',
$proxy_port = '6082', $proxy_port = '6082',
$proxy_path = '/spice_auto.html' $proxy_path = '/spice_auto.html',
# DEPRECATED PARAMETERS
$keymap = undef,
) { ) {
include ::nova::deps include ::nova::deps
if $keymap {
warning('keymap parameter is deprecated, has no effect and will be removed in the future.')
}
if $proxy_host { if $proxy_host {
$html5proxy_base_url = "${proxy_protocol}://${proxy_host}:${proxy_port}${proxy_path}" $html5proxy_base_url = "${proxy_protocol}://${proxy_host}:${proxy_port}${proxy_path}"
nova_config { nova_config {
@ -61,6 +68,5 @@ class nova::compute::spice(
'spice/agent_enabled': value => $agent_enabled; 'spice/agent_enabled': value => $agent_enabled;
'spice/server_listen': value => $server_listen; 'spice/server_listen': value => $server_listen;
'spice/server_proxyclient_address': value => $server_proxyclient_address; 'spice/server_proxyclient_address': value => $server_proxyclient_address;
'spice/keymap': value => $keymap;
} }
} }

View File

@ -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.

View File

@ -122,7 +122,6 @@ describe 'nova::compute' do
it 'configures vnc in nova.conf' 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/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/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( is_expected.to contain_nova_config('vnc/novncproxy_base_url').with_value(
'http://127.0.0.1:6080/vnc_auto.html' 'http://127.0.0.1:6080/vnc_auto.html'
) )
@ -266,7 +265,6 @@ describe 'nova::compute' do
it 'disables vnc in nova.conf' 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/enabled').with_value(false)
is_expected.to contain_nova_config('vnc/vncserver_proxyclient_address').with_ensure('absent') 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') is_expected.to_not contain_nova_config('vnc/novncproxy_base_url')
end end
@ -331,13 +329,6 @@ describe 'nova::compute' do
it { is_expected.to contain_nova_config('DEFAULT/instance_usage_audit_period').with_value('year') } it { is_expected.to contain_nova_config('DEFAULT/instance_usage_audit_period').with_value('year') }
end 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 end
on_supported_os({ on_supported_os({