From b0eb1aff00c3b8ab84c985059b5213b43322fe17 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sat, 8 Jun 2019 02:27:50 +0200 Subject: [PATCH] Remove Unknown variable warnings This is ugly but atleast it supresses the unknown variable warnings. Change-Id: I0ba3c405669305bc8dc3ae138c1b8b93efab4a0e --- manifests/vncproxy/common.pp | 73 ++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 11 deletions(-) diff --git a/manifests/vncproxy/common.pp b/manifests/vncproxy/common.pp index a85d283f0..b989d8422 100644 --- a/manifests/vncproxy/common.pp +++ b/manifests/vncproxy/common.pp @@ -25,25 +25,76 @@ class nova::vncproxy::common ( include ::nova::deps - $vncproxy_host_real = normalize_ip_for_uri(pick( + if defined('$::nova::compute::vncproxy_host') { + $compute_vncproxy_host_real = $::nova::compute::vncproxy_host + } else { + $compute_vncproxy_host_real = undef + } + + if defined('$::nova::vncproxy::host') { + $compat_vncproxy_host_real = $::nova::vncproxy::host + } else { + $compat_vncproxy_host_real = undef + } + + $vncproxy_host_real = normalize_ip_for_uri(pick( $vncproxy_host, - $::nova::compute::vncproxy_host, - $::nova::vncproxy::host, + $compute_vncproxy_host_real, + $compat_vncproxy_host_real, false)) + + if defined('$::nova::compute::vncproxy_protocol') { + $compute_vncproxy_protocol_real = $::nova::compute::vncproxy_protocol + } else { + $compute_vncproxy_protocol_real = undef + } + + if defined('$::nova::vncproxy::vncproxy_protocol') { + $compat_vncproxy_protocol_real = $::nova::vncproxy::vncproxy_protocol + } else { + $compat_vncproxy_protocol_real = undef + } + $vncproxy_protocol_real = pick( $vncproxy_protocol, - $::nova::compute::vncproxy_protocol, - $::nova::vncproxy::vncproxy_protocol, + $compute_vncproxy_protocol_real, + $compat_vncproxy_protocol_real, 'http') - $vncproxy_port_real = pick( + + if defined('$::nova::compute::vncproxy_port') { + $compute_vncproxy_port_real = $::nova::compute::vncproxy_port + } else { + $compute_vncproxy_port_real = undef + } + + if defined('$::nova::vncproxy::port') { + $compat_vncproxy_port_real = $::nova::vncproxy::port + } else { + $compat_vncproxy_port_real = undef + } + + $vncproxy_port_real = pick( $vncproxy_port, - $::nova::compute::vncproxy_port, - $::nova::vncproxy::port, + $compute_vncproxy_port_real, + $compat_vncproxy_port_real, 6080) - $vncproxy_path_real = pick( + + if defined('$::nova::compute::vncproxy_path') { + $compute_vncproxy_path_real = $::nova::compute::vncproxy_path + } else { + $compute_vncproxy_path_real = undef + } + + if defined('$::nova::vncproxy::vncproxy_path') { + $compat_vncproxy_path_real = $::nova::vncproxy::vncproxy_path + } else { + $compat_vncproxy_path_real = undef + } + + $vncproxy_path_real = pick( $vncproxy_path, - $::nova::compute::vncproxy_path, - $::nova::vncproxy::vncproxy_path, + $compute_vncproxy_path_real, + $compat_vncproxy_path_real, '/vnc_auto.html') if ($vncproxy_host_real) {