On Wed, Sep 14, 2016 at 01:20:47PM +0100, 'Viktor Bachraty' via ganeti-devel 
wrote:
> Instances with secondaries in a separate nodegroup from primary can
> result in cluster verify throwing a missing node lock error for LV
> check. This should properly print the node name and the violating
> instance name.

Nice. However, see inline.

[snip]
> -    extra_lv_nodes = set()
> +    extra_lv_nodes = collections.defaultdict(list)

defaultdict is a python 2.5 feature, and technically we currently claim to
support python 2.4 and later. (This is something I want to address very soon,
because 2.4 is really really old). See inline diff to make this use a dict:

-    extra_lv_nodes = collections.defaultdict(list)
+    extra_lv_nodes = {}

>  
>      for inst in self.my_inst_info.values():
>        disks = self.cfg.GetInstanceDisks(inst.uuid)
> @@ -495,16 +496,20 @@ class LUClusterVerifyGroup(LogicalUnit, _VerifyErrors):
>          inst_nodes = self.cfg.GetInstanceNodes(inst.uuid)
>          for nuuid in inst_nodes:
>            if self.all_node_info[nuuid].group != self.group_uuid:
> -            extra_lv_nodes.add(nuuid)
> +            extra_lv_nodes[nuuid].append(inst.name)

-            extra_lv_nodes[nuuid].append(inst.name)
+            if nuuid not in extra_lv_nodes:
+              extra_lv_nodes[nuuid] = inst.name
+            else:
+              extra_lv_nodes[nuuid].append(inst.name)
+

Otherwise, LGTM.

Thanks,
Brian.

Reply via email to