コード例 #1
0
 def _verify_share(self, context, share_id):
     try:
         share = db_api.share_get(context, share_id)
         if not share['is_public']:
             policy.check_policy(context, 'share', 'get', share)
     except exception.NotFound:
         msg = _("Share '%s' not found.") % share_id
         raise exc.HTTPNotFound(explanation=msg)
コード例 #2
0
 def _verify_snapshot(self, context, snapshot_id):
     try:
         snapshot = db_api.share_snapshot_get(context, snapshot_id)
         share = db_api.share_get(context, snapshot['share_id'])
         if not share['is_public']:
             policy.check_policy(context, 'share', 'get', share)
     except exception.NotFound:
         msg = _("Snapshot '%s' not found.") % snapshot_id
         raise exc.HTTPNotFound(explanation=msg)
     return snapshot
コード例 #3
0
 def _verify_snapshot(self, context, snapshot_id):
     try:
         snapshot = db_api.share_snapshot_get(context, snapshot_id)
         share = db_api.share_get(context, snapshot['share_id'])
         if not share['is_public']:
             policy.check_policy(context, 'share', 'get', share)
     except exception.NotFound:
         msg = _("Snapshot '%s' not found.") % snapshot_id
         raise exc.HTTPNotFound(explanation=msg)
     return snapshot
コード例 #4
0
 def _verify_share(self, context, share_id):
     try:
         db_api.share_get(context, share_id)
     except exception.NotFound:
         msg = _("Share '%s' not found.") % share_id
         raise exc.HTTPNotFound(explanation=msg)
コード例 #5
0
 def _verify_share(self, context, share_id):
     try:
         db_api.share_get(context, share_id)
     except exception.NotFound:
         msg = _("Share '%s' not found.") % share_id
         raise exc.HTTPNotFound(explanation=msg)