LGTM.

s/list/tuple

On Feb 24 09:45, Petr Pudlak wrote:
> Before the list of nodes of an instance was created from a set, listing
> the nodes in alphabetical order. This patch ensures that the primary
> node is always the first one in the list.
> 
> Signed-off-by: Petr Pudlak <[email protected]>
> ---
>  lib/objects.py | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/objects.py b/lib/objects.py
> index aca6c66..e9cee22 100644
> --- a/lib/objects.py
> +++ b/lib/objects.py
> @@ -1118,10 +1118,11 @@ class Instance(TaggableObject):
>            _Helper(nodes, child)
>  
>      all_nodes = set()
> -    all_nodes.add(self.primary_node)
>      for device in self.disks:
>        _Helper(all_nodes, device)
> -    return tuple(all_nodes)
> +    # ensure that the primary node is always the first
> +    all_nodes.discard(self.primary_node)
> +    return (self.primary_node, ) + tuple(all_nodes)
>  
>    all_nodes = property(_ComputeAllNodes, None, None,
>                         "List of names of all the nodes of the instance")
> -- 
> 1.9.0.rc1.175.g0b1dcb5
> 

-- 
Jose Antonio Lopes
Ganeti Engineering
Google Germany GmbH
Dienerstr. 12, 80331, München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores
Steuernummer: 48/725/00206
Umsatzsteueridentifikationsnummer: DE813741370

Reply via email to