Esempio n. 1
0
 def show(self, req, id):
     context = req.environ['nova.context']
     authorize_show(context)
     try:
         sqlalchemy_api.authorize_project_context(context, id)
         return self._format_quota_set(id, self._get_quotas(context, id))
     except exception.NotAuthorized:
         raise webob.exc.HTTPForbidden()
Esempio n. 2
0
 def show(self, req, id):
     context = req.environ['nova.context']
     authorize_show(context)
     try:
         sqlalchemy_api.authorize_project_context(context, id)
         return self._format_quota_set(id, self._get_quotas(context, id))
     except exception.NotAuthorized:
         raise webob.exc.HTTPForbidden()
Esempio n. 3
0
 def show(self, req, id):
     context = req.environ['nova.context']
     authorize_action(context, 'show')
     params = self._request_params(req)
     remaining = False
     if 'remaining' in params:
         remaining = utils.bool_from_str(params["remaining"][0])
     user_id = None
     if 'user_id' in params:
         user_id = params["user_id"][0]
     try:
         sqlalchemy_api.authorize_project_context(context, id)
         return self._format_quota_set(id,
                     self._get_quotas(context, id, user_id, remaining))
     except exception.NotAuthorized:
         raise webob.exc.HTTPForbidden()
Esempio n. 4
0
 def show(self, req, id):
     context = req.environ['nova.context']
     authorize_action(context, 'show')
     params = self._request_params(req)
     remaining = False
     if 'remaining' in params:
         remaining = utils.bool_from_str(params["remaining"][0])
     user_id = None
     if 'user_id' in params:
         user_id = params["user_id"][0]
     try:
         sqlalchemy_api.authorize_project_context(context, id)
         return self._format_quota_set(
             id, self._get_quotas(context, id, user_id, remaining))
     except exception.NotAuthorized:
         raise webob.exc.HTTPForbidden()