From 9e160ecedc2901dfc4f543860278c82c836c65ce Mon Sep 17 00:00:00 2001 From: venu kolli Date: Thu, 26 Apr 2018 15:37:14 -0700 Subject: [PATCH] getting nova container list of containers in report_gen , In helm provisiong , replica set for nova is configured to 2 so one of the openstack node is not having nova container . Closes-Bug: 1767211 Change-Id: I6a465606bcddf4b2e0496676cab995ec154da7d9 --- tools/report_gen.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/report_gen.py b/tools/report_gen.py index 79ea0fd07..7b050003a 100644 --- a/tools/report_gen.py +++ b/tools/report_gen.py @@ -176,10 +176,14 @@ def get_build_id(self): if not build_id: build_id = local(cmd, capture=True) build_sku = self.get_os_env("SKU") + container = None if not build_sku and self.orchestrator == 'openstack': - container = self.host_data[self.openstack_ips[0]].get( + for openstack_ip in self.openstack_ips: + container = self.host_data[openstack_ip].get( 'containers', {}).get('nova') - build_sku=get_build_sku(self.openstack_ips[0],self.host_data[self.openstack_ip]['password'], + if container: + break + build_sku=get_build_sku(openstack_ip,self.host_data[openstack_ip]['password'], container=container) if (build_id.count('.') > 3): build_id=re.match(r'([0-9\.-]*)\.',build_id).group(1)