From 3669b824829e823bb3d7f3de1788beb689a4f978 Mon Sep 17 00:00:00 2001 From: Abhay Joshi Date: Thu, 10 Mar 2016 15:53:48 -0800 Subject: [PATCH] Closes-Bug: #1550650 When upgrading from 2.2x code to 3.0, keystone.conf admin_token is changed to newly generated value, however all other contrail files which used to have admin_token in 2.2x code and were generated with value from 2.2x code retained the old value. In 3.x code, none of the contrail files use token, but since in upgrade case, old files were retained and had token, we had token mismatch in config files and this resulted in openstack neutron commands failing on upgrade. The change is to use the admin_token value from cluster.json (will be the case when cluster is created with 2.2x SM) in SM 3.0 when populating hiera data for openstack. If cluster.json does not have admin_token, then only use generated value. Tested : Successful upgrade from contrail 2.22b117 provisioned using SM 2.22build117, then upgrade SM to R3.0b2723 and upgrade contrail to 3.0B2723. Also tested fresh provision of contrail 3.0b 2723 with SM 3.0b2723. Change-Id: Ieec1645bf9c340a5db8b47fcbc0771aebc9847eb --- src/server_mgr_puppet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server_mgr_puppet.py b/src/server_mgr_puppet.py index 5f108229..df5b4153 100644 --- a/src/server_mgr_puppet.py +++ b/src/server_mgr_puppet.py @@ -735,7 +735,9 @@ def build_openstack_hiera_file( mysql_allowed_hosts = list( set(mysql_allowed_hosts + os_ip_list + config_ip_list + role_ips_dict['config'] + role_ips_dict['openstack'] )) # end else openstack_params - keystone_admin_token = (subprocess.Popen(["openssl", "rand", "-hex", "10"],stdout=subprocess.PIPE).communicate()[0]).rstrip() + keystone_admin_token = cluster_params.get( + "service_token", + (subprocess.Popen(["openssl", "rand", "-hex", "10"],stdout=subprocess.PIPE).communicate()[0]).rstrip()) template_vals = { '__openstack_ip__': openstack_ip, '__subnet_mask__': subnet_mask,