Commit 29b8eaee authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

TLReplaceDisks: Use implicit loop for dictionary


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 1bee66f3
...@@ -8203,13 +8203,10 @@ class TLReplaceDisks(Tasklet): ...@@ -8203,13 +8203,10 @@ class TLReplaceDisks(Tasklet):
instance.FindDisk(disk_idx) instance.FindDisk(disk_idx)
# Get secondary node IP addresses # Get secondary node IP addresses
node_2nd_ip = {} self.node_secondary_ip = \
dict((node_name, self.cfg.GetNodeInfo(node_name).secondary_ip)
for node_name in [self.target_node, self.other_node, self.new_node]: for node_name in touched_nodes
if node_name is not None: if node_name is not None)
node_2nd_ip[node_name] = self.cfg.GetNodeInfo(node_name).secondary_ip
self.node_secondary_ip = node_2nd_ip
def Exec(self, feedback_fn): def Exec(self, feedback_fn):
"""Execute disk replacement. """Execute disk replacement.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment