On Mon, Sep 08, 2008 at 03:51:27PM +0100, Guido Trotter wrote:
> 
> This will be used to lock the instance's nodes in addition to some more.
> ---
>  lib/cmdlib.py |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/cmdlib.py b/lib/cmdlib.py
> index e450a6f..9eb109e 100644
> --- a/lib/cmdlib.py
> +++ b/lib/cmdlib.py
> @@ -298,7 +298,11 @@ class LogicalUnit(object):
>        wanted_nodes.append(instance.primary_node)
>        if not primary_only:
>          wanted_nodes.extend(instance.secondary_nodes)
> -    self.needed_locks[locking.LEVEL_NODE] = wanted_nodes
> +
> +    if self.recalculate_locks[locking.LEVEL_NODE] == 'replace':
> +      self.needed_locks[locking.LEVEL_NODE] = wanted_nodes
> +    elif self.recalculate_locks[locking.LEVEL_NODE] == 'append':
> +      self.needed_locks[locking.LEVEL_NODE].extend(wanted_nodes)

urght, more hardcoded constants. Please add locking.APPEND_LOCKS or
similary named constant...

iustin

Reply via email to