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)
 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
Beispiel #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
 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)
 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)