Revision d2fe2bfb lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
10100 | 10100 |
|
10101 | 10101 |
self.replacer = TLReplaceDisks(self, self.op.instance_name, self.op.mode, |
10102 | 10102 |
self.op.iallocator, self.op.remote_node, |
10103 |
self.op.disks, False, self.op.early_release) |
|
10103 |
self.op.disks, False, self.op.early_release, |
|
10104 |
self.op.ignore_ipolicy) |
|
10104 | 10105 |
|
10105 | 10106 |
self.tasklets = [self.replacer] |
10106 | 10107 |
|
... | ... | |
10182 | 10183 |
|
10183 | 10184 |
""" |
10184 | 10185 |
def __init__(self, lu, instance_name, mode, iallocator_name, remote_node, |
10185 |
disks, delay_iallocator, early_release): |
|
10186 |
disks, delay_iallocator, early_release, ignore_ipolicy):
|
|
10186 | 10187 |
"""Initializes this class. |
10187 | 10188 |
|
10188 | 10189 |
""" |
... | ... | |
10196 | 10197 |
self.disks = disks |
10197 | 10198 |
self.delay_iallocator = delay_iallocator |
10198 | 10199 |
self.early_release = early_release |
10200 |
self.ignore_ipolicy = ignore_ipolicy |
|
10199 | 10201 |
|
10200 | 10202 |
# Runtime data |
10201 | 10203 |
self.instance = None |
... | ... | |
10418 | 10420 |
if not self.disks: |
10419 | 10421 |
self.disks = range(len(self.instance.disks)) |
10420 | 10422 |
|
10423 |
# TODO: This is ugly, but right now we can't distinguish between internal |
|
10424 |
# submitted opcode and external one. We should fix that. |
|
10425 |
if self.remote_node_info: |
|
10426 |
# We change the node, lets verify it still meets instance policy |
|
10427 |
new_group_info = self.cfg.GetNodeGroup(self.remote_node_info.group) |
|
10428 |
ipolicy = _CalculateGroupIPolicy(self.cfg.GetClusterInfo(), |
|
10429 |
new_group_info) |
|
10430 |
_CheckTargetNodeIPolicy(self, ipolicy, instance, self.remote_node_info, |
|
10431 |
ignore=self.ignore_ipolicy) |
|
10432 |
|
|
10421 | 10433 |
# TODO: compute disk parameters |
10422 | 10434 |
primary_node_info = self.cfg.GetNodeInfo(instance.primary_node) |
10423 | 10435 |
secondary_node_info = self.cfg.GetNodeInfo(secondary_node) |
Also available in: Unified diff