diff options
author | Yun Huang <yun.huang@windriver.com> | 2018-04-27 18:30:42 +0800 |
---|---|---|
committer | Yun Huang <yun.huang@windriver.com> | 2018-04-27 18:30:42 +0800 |
commit | 8a033231ae6341745cd4a5b12422f10c261c5c2f (patch) | |
tree | 9a096464ec3d28dbf513840690f52fedd1b7a8d3 | |
parent | e1d221000f6aaa52312c4138eac239a93593ba32 (diff) |
Logging enhancement for base registeration
Change-Id: I5aad3f0b8738a6b922720a776ec05425080e6f4c
Issue-ID: MULTICLOUD-178
Signed-off-by: Yun Huang <yun.huang@windriver.com>
-rw-r--r-- | share/newton_base/registration/registration.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/share/newton_base/registration/registration.py b/share/newton_base/registration/registration.py index 7513fd79..ecf613b8 100644 --- a/share/newton_base/registration/registration.py +++ b/share/newton_base/registration/registration.py @@ -42,12 +42,14 @@ class Registry(APIView): service = {'service_type': service_type, 'interface': 'public', 'region_id': viminfo['cloud_region_id']} + logger.info("making request with URI:%s" % resource_url) resp = session.get(resource_url, endpoint_filter=service) + logger.info("request returns with status %s" % resp.status_code) + if resp.status_code == status.HTTP_200_OK: + logger.debug("with content:%s" % resp.json()) + pass content = resp.json() - self._logger.debug("vimid: %s, req: %s,resp code: %s, body: %s" - % (vimid, resource_url, resp.status_code,content)) - if resp.status_code != status.HTTP_200_OK: return # failed to discover resources return content.get(content_key) @@ -230,11 +232,14 @@ class Registry(APIView): service = {'service_type': "image", 'interface': 'public', 'region_id': viminfo['cloud_region_id']} + logger.info("making request with URI:%s" % req_resource) resp = session.get(req_resource, endpoint_filter=service) + logger.info("request returns with status %s" % resp.status_code) + if resp.status_code == status.HTTP_200_OK: + logger.debug("with content:%s" % resp.json()) + pass content = resp.json() - self._logger.debug("vimid: %s, req: %s,resp code: %s, body: %s" - % (vimid, req_resource, resp.status_code, content)) # if resp.status_code == status.HTTP_200_OK: # parse the schema? TBD # self.update_image(cloud_owner, cloud_region_id, image_info) @@ -270,10 +275,13 @@ class Registry(APIView): service = {'service_type': "compute", 'interface': 'public', 'region_id': viminfo['cloud_region_id']} + logger.info("making request with URI:%s" % req_resource) resp = session.get(req_resource, endpoint_filter=service) + logger.info("request returns with status %s" % resp.status_code) + if resp.status_code == status.HTTP_200_OK: + logger.debug("with content:%s" % resp.json()) + pass content = resp.json() - self._logger.debug("vimid: %s, req: %s,resp code: %s, body: %s" - % (vimid, req_resource, resp.status_code, content)) if resp.status_code != status.HTTP_200_OK and not content[0]: continue az_info['hypervisor-type'] = content['hypervisors'][0]['hypervisor_type']\ |