예제 #1
0
파일: quotas.py 프로젝트: DSpeichert/nova
 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()
예제 #2
0
파일: quotas.py 프로젝트: paulmathews/nova
 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()
예제 #3
0
파일: quotas.py 프로젝트: bhuvan/nova
 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()
예제 #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()