def show(self, req, share_instance_id, export_location_uuid): """Return data about the requested export location.""" context = req.environ['manila.context'] self._verify_share_instance(context, share_instance_id) try: export_location = db_api.share_export_location_get_by_uuid( context, export_location_uuid) return self._view_builder.detail(req, export_location) except exception.ExportLocationNotFound as e: raise exc.HTTPNotFound(explanation=six.text_type(e))
def show(self, req, share_instance_id, export_location_uuid): """Return data about the requested export location.""" context = req.environ['manila.context'] self._verify_share_instance(context, share_instance_id) try: el = db_api.share_export_location_get_by_uuid( context, export_location_uuid) return self._view_builder.detail(el) except exception.ExportLocationNotFound as e: raise exc.HTTPNotFound(explanation=six.text_type(e))
def _show(self, req, share_replica_id, export_location_uuid): """Return data about the requested export location.""" context = req.environ['manila.context'] self._verify_share_replica(context, share_replica_id) try: export_location = db_api.share_export_location_get_by_uuid( context, export_location_uuid) return self._view_builder.detail(req, export_location, replica=True) except exception.ExportLocationNotFound as e: raise exc.HTTPNotFound(explanation=e.message)
def show(self, req, share_id, export_location_uuid): """Return data about the requested export location.""" context = req.environ['manila.context'] self._verify_share(context, share_id) try: export_location = db_api.share_export_location_get_by_uuid( context, export_location_uuid) except exception.ExportLocationNotFound: msg = _("Export location '%s' not found.") % export_location_uuid raise exc.HTTPNotFound(explanation=msg) if export_location.is_admin_only and not context.is_admin: raise exc.HTTPForbidden() return self._view_builder.detail(req, export_location)
def show(self, req, share_id, export_location_uuid): """Return data about the requested export location.""" context = req.environ['manila.context'] self._verify_share(context, share_id) try: export_location = db_api.share_export_location_get_by_uuid( context, export_location_uuid) except exception.ExportLocationNotFound: msg = _("Export location '%s' not found.") % export_location_uuid raise exc.HTTPNotFound(explanation=msg) if export_location.is_admin_only and not context.is_admin: raise exc.HTTPForbidden() return self._view_builder.detail(req, export_location)
def _show(self, req, share_id, export_location_uuid, ignore_secondary_replicas=False): context = req.environ['manila.context'] self._verify_share(context, share_id) try: export_location = db_api.share_export_location_get_by_uuid( context, export_location_uuid, ignore_secondary_replicas=ignore_secondary_replicas) except exception.ExportLocationNotFound: msg = _("Export location '%s' not found.") % export_location_uuid raise exc.HTTPNotFound(explanation=msg) if export_location.is_admin_only and not context.is_admin: raise exc.HTTPForbidden() return self._view_builder.detail(req, export_location)
def _show(self, req, share_id, export_location_uuid, ignore_secondary_replicas=False): context = req.environ['manila.context'] self._verify_share(context, share_id) try: export_location = db_api.share_export_location_get_by_uuid( context, export_location_uuid, ignore_secondary_replicas=ignore_secondary_replicas) except exception.ExportLocationNotFound: msg = _("Export location '%s' not found.") % export_location_uuid raise exc.HTTPNotFound(explanation=msg) if export_location.is_admin_only and not context.is_admin: raise exc.HTTPForbidden() return self._view_builder.detail(req, export_location)