Revision 1c3231aa lib/cmdlib/tags.py
b/lib/cmdlib/tags.py | ||
---|---|---|
29 | 29 |
from ganeti import objects |
30 | 30 |
from ganeti import utils |
31 | 31 |
from ganeti.cmdlib.base import NoHooksLU |
32 |
from ganeti.cmdlib.common import ExpandNodeName, ExpandInstanceName, ShareAll |
|
32 |
from ganeti.cmdlib.common import ExpandNodeUuidAndName, ExpandInstanceName, \ |
|
33 |
ShareAll |
|
33 | 34 |
|
34 | 35 |
|
35 | 36 |
class TagsLU(NoHooksLU): # pylint: disable=W0223 |
... | ... | |
43 | 44 |
self.needed_locks = {} |
44 | 45 |
|
45 | 46 |
if self.op.kind == constants.TAG_NODE: |
46 |
self.op.name = ExpandNodeName(self.cfg, self.op.name) |
|
47 |
(self.node_uuid, _) = \ |
|
48 |
ExpandNodeUuidAndName(self.cfg, None, self.op.name) |
|
47 | 49 |
lock_level = locking.LEVEL_NODE |
48 |
lock_name = self.op.name
|
|
50 |
lock_name = self.node_uuid
|
|
49 | 51 |
elif self.op.kind == constants.TAG_INSTANCE: |
50 | 52 |
self.op.name = ExpandInstanceName(self.cfg, self.op.name) |
51 | 53 |
lock_level = locking.LEVEL_INSTANCE |
... | ... | |
75 | 77 |
if self.op.kind == constants.TAG_CLUSTER: |
76 | 78 |
self.target = self.cfg.GetClusterInfo() |
77 | 79 |
elif self.op.kind == constants.TAG_NODE: |
78 |
self.target = self.cfg.GetNodeInfo(self.op.name)
|
|
80 |
self.target = self.cfg.GetNodeInfo(self.node_uuid)
|
|
79 | 81 |
elif self.op.kind == constants.TAG_INSTANCE: |
80 | 82 |
self.target = self.cfg.GetInstanceInfo(self.op.name) |
81 | 83 |
elif self.op.kind == constants.TAG_NODEGROUP: |
Also available in: Unified diff