コード例 #1
0
    def execute(self, context, snapshot_ref, manage_existing_ref):
        snapshot_id = snapshot_ref['id']
        if not self.driver.initialized:
            driver_name = (self.driver.configuration.
                           safe_get('volume_backend_name'))
            LOG.error(_LE("Unable to manage existing snapshot. "
                          "Volume driver %s not initialized."), driver_name)
            flow_common.error_out_snapshot(context, self.db, snapshot_id,
                                           reason=_("Volume driver %s "
                                                    "not initialized.") %
                                           driver_name)
            raise exception.DriverNotInitialized()

        size = self.driver.manage_existing_snapshot_get_size(
            snapshot=snapshot_ref,
            existing_ref=manage_existing_ref)

        return {'size': size,
                'snapshot_properties': snapshot_ref}
コード例 #2
0
    def execute(self, context, snapshot_ref, manage_existing_ref):
        snapshot_id = snapshot_ref['id']
        if not self.driver.initialized:
            driver_name = (self.driver.configuration.
                           safe_get('volume_backend_name'))
            LOG.error(_LE("Unable to manage existing snapshot. "
                          "Volume driver %s not initialized."), driver_name)
            flow_common.error_out_snapshot(context, self.db, snapshot_id,
                                           reason=_("Volume driver %s "
                                                    "not initialized.") %
                                           driver_name)
            raise exception.DriverNotInitialized()

        size = self.driver.manage_existing_snapshot_get_size(
            snapshot=snapshot_ref,
            existing_ref=manage_existing_ref)

        return {'size': size,
                'snapshot_properties': snapshot_ref}
コード例 #3
0
    def revert(self, context, snapshot_id, result, **kwargs):
        if isinstance(result, ft.Failure):
            return

        flow_common.error_out_snapshot(context, self.db, snapshot_id)
        LOG.error(_LE("Snapshot %s: create failed"), snapshot_id)
コード例 #4
0
    def revert(self, context, snapshot_id, result, **kwargs):
        if isinstance(result, ft.Failure):
            return

        flow_common.error_out_snapshot(context, self.db, snapshot_id)
        LOG.error(_LE("Snapshot %s: create failed"), snapshot_id)