summaryrefslogtreecommitdiffstats
path: root/share/newton_base/openoapi
diff options
context:
space:
mode:
authorYun Huang <yun.huang@windriver.com>2018-04-24 09:57:35 +0800
committerYun Huang <yun.huang@windriver.com>2018-04-24 09:57:35 +0800
commit880a62fc56933e4e16b9a25d66304512307add54 (patch)
treeaf4eecb3aebca2f5622be9c0ae6fa8340e078fae /share/newton_base/openoapi
parentf486db786d4b4d2abe58e159d30f39f312bc1336 (diff)
Logging enhancement for openo hosts API
Change-Id: I7b5dc8c9fd82d2dfff4d922ac2eba0a0b047b37b Issue-ID: MULTICLOUD-178 Signed-off-by: Yun Huang <yun.huang@windriver.com>
Diffstat (limited to 'share/newton_base/openoapi')
-rw-r--r--share/newton_base/openoapi/hosts.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/share/newton_base/openoapi/hosts.py b/share/newton_base/openoapi/hosts.py
index 60debf54..ddcbe4f0 100644
--- a/share/newton_base/openoapi/hosts.py
+++ b/share/newton_base/openoapi/hosts.py
@@ -38,7 +38,10 @@ class Hosts(APIView):
]
def get(self, request, vimid="", tenantid="", hostname=""):
- logger.debug("Hosts--get::> %s" % request.data)
+ logger.info("vimid, tenantid, hostname = %s,%s,%s" % (vimid, tenantid, hostname))
+ if request.data:
+ logger.debug("With data = %s" % request.data)
+ pass
try:
#prepare request resource to vim instance
req_resouce = "/os-hosts"
@@ -72,8 +75,12 @@ class Hosts(APIView):
self.host_keys_mapping)
content["host"].append(res['resource'])
+ logger.info("response with status = %s" % resp.status_code)
+
return Response(data=content, status=resp.status_code)
+
except VimDriverNewtonException as e:
+ logger.error("response with status = %s" % e.status_code)
return Response(data={'error': e.content}, status=e.status_code)
except HttpError as e:
logger.error("HttpError: status:%s, response:%s" % (e.http_status, e.response.json()))