summaryrefslogtreecommitdiffstats
path: root/share/newton_base/openoapi/limits.py
diff options
context:
space:
mode:
authorBin Yang <bin.yang@windriver.com>2019-05-28 05:32:54 +0000
committerBin Yang <bin.yang@windriver.com>2019-05-28 05:32:54 +0000
commit9154720606df1bb43e501a63cd23beca77a409eb (patch)
tree8c90d5891f45c28a408bc52100ff78c696186380 /share/newton_base/openoapi/limits.py
parenteb1e6c75c236bd88a3c371befebcb56fa4f9f090 (diff)
Fix issue of v1/.../tenants API
Fix all openoapi v1 which use logger Change-Id: Iaf82c1ca17959725531f6b340e3e770844dd222c Issue-ID: MULTICLOUD-657 Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'share/newton_base/openoapi/limits.py')
-rw-r--r--share/newton_base/openoapi/limits.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/share/newton_base/openoapi/limits.py b/share/newton_base/openoapi/limits.py
index 4404972e..ee5f01c3 100644
--- a/share/newton_base/openoapi/limits.py
+++ b/share/newton_base/openoapi/limits.py
@@ -37,13 +37,17 @@ class Limits(APIView):
service_volume = {'service_type': 'volumev2',
'interface': 'public'}
+ def __init__(self):
+ super(Limits, self).__init__()
+ self._logger = logger
+
def get(self, request, vimid="", tenantid=""):
logger.info("vimid, tenantid = %s,%s" % (vimid, tenantid))
if request.data:
logger.debug("With data = %s" % request.data)
pass
try:
- #get limits first
+ # get limits first
# prepare request resource to vim instance
req_resouce = "/limits"
vim = VimDriverUtils.get_vim_info(vimid)
@@ -68,7 +72,7 @@ class Limits(APIView):
}
content_all.update(vim_dict)
- #now get quota
+ # now get quota
# prepare request resource to vim instance
req_resouce = "/v2.0/quotas/%s" % tenantid
@@ -82,7 +86,7 @@ class Limits(APIView):
content = resp.json()
content_all.update(content['quota'])
- #now get volume limits
+ # now get volume limits
# prepare request resource to vim instance
req_resouce = "/limits"
@@ -112,6 +116,10 @@ class Limits(APIView):
class APIv1Limits(Limits):
+ def __init__(self):
+ super(APIv1Limits, self).__init__()
+ self._logger = logger
+
def get(self, request, cloud_owner="", cloud_region_id="", tenantid=""):
self._logger.info("%s, %s" % (cloud_owner, cloud_region_id))