replace-disks: fix --ignore-ipolicy
authorApollon Oikonomopoulos <apoikos@gmail.com>
Mon, 31 Aug 2015 14:20:36 +0000 (17:20 +0300)
committerKlaus Aehlig <aehlig@google.com>
Mon, 31 Aug 2015 16:16:52 +0000 (18:16 +0200)
CheckTargetNodeIPolicy was expecting an LU, but got a Tasklet instead.
This caused gnt-instance replace-disks --ignore-ipolicy to fail with a
"'TLReplaceDisks' object has no attribute 'LogWarning'" message in the
presence policy-related warnings. We fix this by passing the calling LU
to CheckTargetNodeIPolicy.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

lib/cmdlib/instance_storage.py

index 333ae09..9ce9ba8 100644 (file)
@@ -2080,7 +2080,7 @@ class TLReplaceDisks(Tasklet):
       cluster = self.cfg.GetClusterInfo()
       ipolicy = ganeti.masterd.instance.CalculateGroupIPolicy(cluster,
                                                               new_group_info)
       cluster = self.cfg.GetClusterInfo()
       ipolicy = ganeti.masterd.instance.CalculateGroupIPolicy(cluster,
                                                               new_group_info)
-      CheckTargetNodeIPolicy(self, ipolicy, self.instance,
+      CheckTargetNodeIPolicy(self.lu, ipolicy, self.instance,
                              self.remote_node_info, self.cfg,
                              ignore=self.ignore_ipolicy)
 
                              self.remote_node_info, self.cfg,
                              ignore=self.ignore_ipolicy)