From 591cdc9da7149fa4e68eac0de2efa8efd25281d6 Mon Sep 17 00:00:00 2001 From: Bin Yang Date: Thu, 16 Aug 2018 04:32:18 +0000 Subject: multi-region discovery Decouple the openstack region id from cloud-region-id Change-Id: If4bfacf05d87ca4bc97a485d4153f4f379ad451a Issue-ID: MULTICLOUD-311 Signed-off-by: Bin Yang --- share/newton_base/openoapi/hypervisor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'share/newton_base/openoapi/hypervisor.py') diff --git a/share/newton_base/openoapi/hypervisor.py b/share/newton_base/openoapi/hypervisor.py index eb0debd4..bfde0f51 100755 --- a/share/newton_base/openoapi/hypervisor.py +++ b/share/newton_base/openoapi/hypervisor.py @@ -72,7 +72,11 @@ class Hypervisors(APIView): vim["domain"] = "Default" sess = VimDriverUtils.get_session(vim, tenantid) - logger.info("making request with URI:%s" % req_resource) + self.service['region_id'] = vim['openstack_region_id'] \ + if vim.get('openstack_region_id') \ + else vim['cloud_region_id'] + + logger.info("making request with URI:%s" % req_resouce) resp = sess.get(req_resource, endpoint_filter = self.service) -- cgit 1.2.3-korg