def _check_action_lock(target, action): if action in consts.LOCK_BYPASS_ACTIONS: return elif (action in list(consts.CLUSTER_ACTION_NAMES) and cl.ClusterLock.is_locked(target)): raise exception.ResourceIsLocked( action=action, type='cluster', id=target) elif (action in list(consts.NODE_ACTION_NAMES) and nl.NodeLock.is_locked(target)): raise exception.ResourceIsLocked( action=action, type='node', id=target)
def _check_action_lock(target, action): if action == consts.CLUSTER_DELETE: # CLUSTER_DELETE actions do not care about cluster locks return elif (action in list(consts.CLUSTER_ACTION_NAMES) and cl.ClusterLock.is_locked(target)): raise exception.ResourceIsLocked( action=action, type='cluster', id=target) elif (action in list(consts.NODE_ACTION_NAMES) and nl.NodeLock.is_locked(target)): raise exception.ResourceIsLocked( action=action, type='node', id=target)