diff options
author | Bin Yang <bin.yang@windriver.com> | 2018-08-16 04:32:18 +0000 |
---|---|---|
committer | Bin Yang <bin.yang@windriver.com> | 2018-08-17 06:21:56 +0000 |
commit | 591cdc9da7149fa4e68eac0de2efa8efd25281d6 (patch) | |
tree | fa75681ece5154f4215d78f104661fa99419b504 /share/newton_base/proxy | |
parent | 400e1b7c35a1db4cdcf20f4453631bc0888a330f (diff) |
multi-region discovery
Decouple the openstack region id from cloud-region-id
Change-Id: If4bfacf05d87ca4bc97a485d4153f4f379ad451a
Issue-ID: MULTICLOUD-311
Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'share/newton_base/proxy')
-rw-r--r-- | share/newton_base/proxy/dnsaasdelegate.py | 5 | ||||
-rw-r--r-- | share/newton_base/proxy/services.py | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/share/newton_base/proxy/dnsaasdelegate.py b/share/newton_base/proxy/dnsaasdelegate.py index 4ffe29f8..07ba1b51 100644 --- a/share/newton_base/proxy/dnsaasdelegate.py +++ b/share/newton_base/proxy/dnsaasdelegate.py @@ -128,9 +128,12 @@ class DnsaasDelegate(Services): service = { 'service_type': servicetype, 'interface': interface, - 'region_id': regionid + 'region_id': vim['openstack_region_id'] + if vim.get('openstack_region_id') + else vim['cloud_region_id'] } + req_resource = requri querystr = VimDriverUtils.get_query_part(request) if querystr: diff --git a/share/newton_base/proxy/services.py b/share/newton_base/proxy/services.py index a6076bb7..6aa1bbce 100644 --- a/share/newton_base/proxy/services.py +++ b/share/newton_base/proxy/services.py @@ -103,9 +103,12 @@ class Services(APIView): service = { 'service_type': servicetype, 'interface': interface, - 'region_id': regionid + 'region_id': vim['openstack_region_id'] + if vim.get('openstack_region_id') + else vim['cloud_region_id'] } + querystr = VimDriverUtils.get_query_part(request) if querystr: req_resource += "?" + querystr @@ -183,7 +186,11 @@ class Services(APIView): interface = 'public' service = {'service_type': servicetype, 'interface': interface, - 'region_id': regionid} + 'region_id': vim['openstack_region_id'] + if vim.get('openstack_region_id') + else vim['cloud_region_id'] + } + self._logger.info("service head request with uri %s" % (req_resource)) resp = sess.head(req_resource, endpoint_filter=service) |