2009/7/21 Iustin Pop <[email protected]>:
> On Tue, Jul 21, 2009 at 02:32:10PM +0200, Michael Hanselmann wrote:
>> --- a/lib/cmdlib.py
>> +++ b/lib/cmdlib.py
>> +  def _GetNodeSecondaryInstances(self, node_name):
>> +    """Returns secondary instances on a node.
>> +
>> +    """
>> +    instances = []
>> +
>> +    for (_, inst) in self.cfg.GetAllInstancesInfo().iteritems():
>> +      if node_name in inst.secondary_nodes:
>> +        instances.append(inst)
>> +
>> +    return instances
>
> this function is generic enough that it should be moved out of this class 
> (and into a separate commit).

See the other mail.

>> +  def Exec(self, feedback_fn):
>> +    """Execute disk replacement.
>> +
>> +    """
>> +    feedback_fn("Replacing secondary disks on %s for instance(s) %s" %
>> +                (self.op.node_name, ", ".join(self.instance_names)))
>
> there is no "secondary disk". "changing the secondary node" maybe.

-    feedback_fn("Replacing secondary disks on %s for instance(s) %s" %
-                (self.op.node_name, ", ".join(self.instance_names)))
+    feedback_fn("Replacing the secondary node for instance(s) %s" %
+                (", ".join(self.instance_names),))

>> +    cur_inst_names = [inst.name for inst in
>> +                      self._GetNodeSecondaryInstances(self.op.node_name)]
>> +    diff = set(cur_inst_names) - set(self.instance_names)
>> +    if diff:
>> +      feedback_fn(("The following instances' secondary node was changed "
>> +                   " to %s during this operation: %s") %
>> +                  (self.op.node_name, ", ".join(diff)))
>
> hmm, since the node is locked here, when do you expect to see this? in case 
> of errors?

You're right, the nodes are locked. I removed this part completely.

Regards,
Michael

Reply via email to