From ae6a94b784bb1d8f8202677d41eca7ccb751ca52 Mon Sep 17 00:00:00 2001 From: John Hua Date: Tue, 29 Mar 2016 11:20:26 +0800 Subject: [PATCH] Fix novnc proxy scheme In MOS 7.0 services and horizon go with https by default, while then in 8.0 it turns to http. Thus the setting of novnc proxy needs to be altered. Change-Id: I1a675dec62941107cbcd9503d16fd13651aab55a --- deployment_scripts/compute_post_deployment.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deployment_scripts/compute_post_deployment.py b/deployment_scripts/compute_post_deployment.py index c3d10ed..e69e19e 100755 --- a/deployment_scripts/compute_post_deployment.py +++ b/deployment_scripts/compute_post_deployment.py @@ -181,7 +181,7 @@ def install_xenapi_sdk(): execute('cp', 'XenAPI.py', DIST_PACKAGES_DIR) -def create_novacompute_conf(himn, username, password, public_ip): +def create_novacompute_conf(himn, username, password, public_ip, services_ssl): """Fill nova-compute.conf with HIMN IP and root password. """ mgmt_if = netifaces.ifaddresses('br-mgmt') if mgmt_if and mgmt_if.get(netifaces.AF_INET) \ @@ -196,8 +196,9 @@ def create_novacompute_conf(himn, username, password, public_ip): cf.read(filename) cf.set('DEFAULT', 'compute_driver', 'xenapi.XenAPIDriver') cf.set('DEFAULT', 'force_config_drive', 'True') + scheme = "https" if services_ssl else "http" cf.set('DEFAULT', 'novncproxy_base_url', - 'https://%s:6080/vnc_auto.html' % public_ip) + '%s://%s:6080/vnc_auto.html' % (scheme, public_ip)) cf.set('DEFAULT', 'vncserver_proxyclient_address', mgmt_ip) if not cf.has_section('xenserver'): cf.add_section('xenserver') @@ -403,6 +404,9 @@ if __name__ == '__main__': public_ip = astute_get( astute, ('network_metadata', 'vips', 'public', 'ipaddr')) + services_ssl = astute_get( + astute, ('public_ssl', 'services')) + if username and password and endpoints and himn_local: check_hotfix_exists(HIMN_IP, username, password, 'XS65ESP1013') route_to_compute( @@ -415,7 +419,7 @@ if __name__ == '__main__': # port forwarding for novnc forward_port('br-mgmt', himn_eth, HIMN_IP, '80') - create_novacompute_conf(HIMN_IP, username, password, public_ip) + create_novacompute_conf(HIMN_IP, username, password, public_ip, services_ssl) patch_compute_xenapi() restart_services('nova-compute')