Commit 1d789a97 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

cmdlib: Expand instances using helper for repairing disks



Also change the way “share_locks” is filled.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent e730f372
......@@ -2649,10 +2649,7 @@ class LUClusterRepairDiskSizes(NoHooksLU):
def ExpandNames(self):
if self.op.instances:
self.wanted_names = []
for name in self.op.instances:
full_name = _ExpandInstanceName(self.cfg, name)
self.wanted_names.append(full_name)
self.wanted_names = _GetWantedInstances(self, self.op.instances)
self.needed_locks = {
locking.LEVEL_NODE: [],
locking.LEVEL_INSTANCE: self.wanted_names,
......@@ -2664,7 +2661,7 @@ class LUClusterRepairDiskSizes(NoHooksLU):
locking.LEVEL_NODE: locking.ALL_SET,
locking.LEVEL_INSTANCE: locking.ALL_SET,
}
self.share_locks = dict(((i, 1) for i in locking.LEVELS))
self.share_locks = dict.fromkeys(locking.LEVELS, 1)
def DeclareLocks(self, level):
if level == locking.LEVEL_NODE and self.wanted_names is not None:
......
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