def _set_share_replica_error_state(self, context, method, exc, request_spec, action=None): LOG.warning("Failed to schedule_%(method)s: %(exc)s", {'method': method, 'exc': exc}) status_updates = { 'status': constants.STATUS_ERROR, 'replica_state': constants.STATUS_ERROR, } share_replica_id = request_spec.get( 'share_instance_properties').get('id') # Set any snapshot instances to 'error'. replica_snapshots = db.share_snapshot_instance_get_all_with_filters( context, {'share_instance_ids': share_replica_id}) for snapshot_instance in replica_snapshots: db.share_snapshot_instance_update( context, snapshot_instance['id'], {'status': constants.STATUS_ERROR}) db.share_replica_update(context, share_replica_id, status_updates) if action: self.message_api.create( context, action, context.project_id, resource_type=message_field.Resource.SHARE_REPLICA, resource_id=share_replica_id, exception=exc)
def _set_share_replica_error_state(self, context, method, exc, request_spec): LOG.warning(_LW("Failed to schedule_%(method)s: %(exc)s"), {'method': method, 'exc': exc}) status_updates = { 'status': constants.STATUS_ERROR, 'replica_state': constants.STATUS_ERROR, } share_replica_id = request_spec.get( 'share_instance_properties').get('id') # Set any snapshot instances to 'error'. replica_snapshots = db.share_snapshot_instance_get_all_with_filters( context, {'share_instance_ids': share_replica_id}) for snapshot_instance in replica_snapshots: db.share_snapshot_instance_update( context, snapshot_instance['id'], {'status': constants.STATUS_ERROR}) db.share_replica_update(context, share_replica_id, status_updates)
def _set_share_replica_error_state(self, context, method, exc, request_spec): LOG.warning(_LW("Failed to schedule_%(method)s: %(exc)s"), { 'method': method, 'exc': exc }) status_updates = { 'status': constants.STATUS_ERROR, 'replica_state': constants.STATUS_ERROR, } share_replica_id = request_spec.get('share_instance_properties').get( 'id') # Set any snapshot instances to 'error'. replica_snapshots = db.share_snapshot_instance_get_all_with_filters( context, {'share_instance_ids': share_replica_id}) for snapshot_instance in replica_snapshots: db.share_snapshot_instance_update( context, snapshot_instance['id'], {'status': constants.STATUS_ERROR}) db.share_replica_update(context, share_replica_id, status_updates)
def _update(self, *args, **kwargs): db.share_snapshot_instance_update(*args, **kwargs)