summaryrefslogtreecommitdiffstats
path: root/share/newton_base
diff options
context:
space:
mode:
authorXiaohua Zhang <xiaohua.zhang@windriver.com>2018-09-22 16:28:07 +0000
committerXiaohua Zhang <xiaohua.zhang@windriver.com>2018-09-22 16:28:07 +0000
commit280d4850a9ed44721b25c0978a48a02072a1527c (patch)
tree3e86be55e14b102266e948ac984b7331663b9d70 /share/newton_base
parent050812c9ae2b85348b2ff29d4fa3e2ac2fb4fec7 (diff)
Fix unregistry issue
Change-Id: Ia4ddb6f11bf562a046d9f567fd7458b466c8642f Issue-ID: MULTICLOUD-361 Signed-off-by: Xiaohua Zhang <xiaohua.zhang@windriver.com>
Diffstat (limited to 'share/newton_base')
-rw-r--r--share/newton_base/registration/registration.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/share/newton_base/registration/registration.py b/share/newton_base/registration/registration.py
index 84f40d71..fd2cf9aa 100644
--- a/share/newton_base/registration/registration.py
+++ b/share/newton_base/registration/registration.py
@@ -51,7 +51,7 @@ class Registry(APIView):
service['region_name'] = viminfo['openstack_region_id']\
if viminfo.get('openstack_region_id') else viminfo['cloud_region_id']
- self._logger.info("making request with URI:%s" % resource_url)
+ self._logger.info("making request with URI:%s,%s" % (resource_url,service))
resp = session.get(resource_url, endpoint_filter=service)
self._logger.info("request returns with status %s" % resp.status_code)
if resp.status_code == status.HTTP_200_OK:
@@ -1034,7 +1034,7 @@ class Registry(APIView):
# remove all vservers
try:
# get list of vservers
- vservers = tenant['vservers']['vserver']
+ vservers = tenant.get('vservers', {}).get('vserver', [])
for vserver in vservers:
try:
# iterate vport, except will be raised if no l-interface exist
@@ -1058,8 +1058,7 @@ class Registry(APIView):
except Exception:
self._logger.error(traceback.format_exc())
- return None
- pass
+ pass
resource_url = ("/cloud-infrastructure/cloud-regions/"
"cloud-region/%(cloud_owner)s/%(cloud_region_id)s/"