def forget_sr(self, sr_uuid): sr_ref = VolumeHelper.find_sr_by_uuid(self._session, sr_uuid) if sr_ref is None: LOG.INFO(_('SR %s not found in the xapi database') % sr_uuid) return try: VolumeHelper.forget_sr(self._session, sr_uuid) except StorageError, exc: LOG.exception(exc) raise exception.Error(_('Could not forget SR'))
def introduce_sr(self, sr_uuid, label, params): LOG.debug(_("Introducing SR %s") % label) sr_ref = VolumeHelper.find_sr_by_uuid(self._session, sr_uuid) if sr_ref: LOG.debug(_('SR found in xapi database. No need to introduce')) return sr_ref sr_ref = VolumeHelper.introduce_sr(self._session, sr_uuid, label, params) if sr_ref is None: raise exception.Error(_('Could not introduce SR')) return sr_ref
def is_sr_on_host(self, sr_uuid): LOG.debug(_('Checking for SR %s') % sr_uuid) sr_ref = VolumeHelper.find_sr_by_uuid(self._session, sr_uuid) if sr_ref: return True return False