Fix unregistry issue 45/68545/1
authorXiaohua Zhang <xiaohua.zhang@windriver.com>
Sat, 22 Sep 2018 16:28:07 +0000 (16:28 +0000)
committerXiaohua Zhang <xiaohua.zhang@windriver.com>
Sat, 22 Sep 2018 16:28:07 +0000 (16:28 +0000)
Change-Id: Ia4ddb6f11bf562a046d9f567fd7458b466c8642f
Issue-ID: MULTICLOUD-361
Signed-off-by: Xiaohua Zhang <xiaohua.zhang@windriver.com>
ocata/run.sh
share/newton_base/registration/registration.py
windriver/run.sh

index 541eaf1..ecca986 100755 (executable)
@@ -18,6 +18,6 @@ export PYTHONPATH=lib/share
 
 service rabbitmq-server restart
 # make sure only 1 worker due to missing the synchronization between workers now
-nohup celery -A ocata worker --concurrency=1 --loglevel=debug &
+nohup celery -A ocata worker --concurrency=1 --loglevel=info &
 
 uwsgi --http :9006 --module ocata.wsgi --master --processes 4
index 84f40d7..fd2cf9a 100644 (file)
@@ -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/"
index 8729584..5f185bd 100644 (file)
@@ -18,7 +18,7 @@ export PYTHONPATH=lib/share
 
 service rabbitmq-server restart
 # make sure only 1 worker due to missing the synchronization between workers now
-nohup celery -A titanium_cloud worker --concurrency=1 --loglevel=debug &
+nohup celery -A titanium_cloud worker --concurrency=1 --loglevel=info &
 
 #nohup python manage.py runserver 0.0.0.0:9005 2>&1 &
 nohup uwsgi --http :9005 --module titanium_cloud.wsgi --master --processes 4 &