'Undo aggregate operation when pool error raised.'

def undo_aggregate_operation(self, context, op, aggregate, host, set_error):

    try:
        if set_error:
            metadata = {pool_states.KEY: pool_states.ERROR}
            aggregate.update_metadata(metadata)
        op(host)
    except Exception:
        LOG.exception(_('Aggregate    %(aggregate_id)s:    unrecoverable    state    during    operation    on    %(host)s'), {'aggregate_id': aggregate.id, 'host': host})
