Revision 3e512563
b/lib/cmdlib.py | ||
---|---|---|
261 | 261 |
idx + 1, len(self.tasklets)) |
262 | 262 |
tl.CheckPrereq() |
263 | 263 |
else: |
264 |
raise NotImplementedError
|
|
264 |
pass
|
|
265 | 265 |
|
266 | 266 |
def Exec(self, feedback_fn): |
267 | 267 |
"""Execute the LU. |
... | ... | |
441 | 441 |
hasn't been done before. |
442 | 442 |
|
443 | 443 |
""" |
444 |
raise NotImplementedError
|
|
444 |
pass
|
|
445 | 445 |
|
446 | 446 |
def Exec(self, feedback_fn): |
447 | 447 |
"""Execute the tasklet. |
... | ... | |
1018 | 1018 |
mn = self.cfg.GetMasterNode() |
1019 | 1019 |
return env, [], [mn] |
1020 | 1020 |
|
1021 |
def CheckPrereq(self): |
|
1022 |
"""No prerequisites to check. |
|
1023 |
|
|
1024 |
""" |
|
1025 |
return True |
|
1026 |
|
|
1027 | 1021 |
def Exec(self, feedback_fn): |
1028 | 1022 |
"""Nothing to do. |
1029 | 1023 |
|
... | ... | |
2132 | 2126 |
} |
2133 | 2127 |
self.share_locks = dict.fromkeys(locking.LEVELS, 1) |
2134 | 2128 |
|
2135 |
def CheckPrereq(self): |
|
2136 |
"""Check prerequisites. |
|
2137 |
|
|
2138 |
This has no prerequisites. |
|
2139 |
|
|
2140 |
""" |
|
2141 |
pass |
|
2142 |
|
|
2143 | 2129 |
def Exec(self, feedback_fn): |
2144 | 2130 |
"""Verify integrity of cluster disks. |
2145 | 2131 |
|
... | ... | |
2764 | 2750 |
} |
2765 | 2751 |
self.share_locks[locking.LEVEL_NODE] = 1 |
2766 | 2752 |
|
2767 |
def CheckPrereq(self): |
|
2768 |
"""Check prerequisites. |
|
2769 |
|
|
2770 |
""" |
|
2771 |
|
|
2772 | 2753 |
def Exec(self, feedback_fn): |
2773 | 2754 |
"""Redistribute the configuration. |
2774 | 2755 |
|
... | ... | |
2913 | 2894 |
#self.share_locks[locking.LEVEL_NODE] = 1 |
2914 | 2895 |
#self.needed_locks[locking.LEVEL_NODE] = locking.ALL_SET |
2915 | 2896 |
|
2916 |
def CheckPrereq(self): |
|
2917 |
"""Check prerequisites. |
|
2918 |
|
|
2919 |
""" |
|
2920 |
|
|
2921 | 2897 |
@staticmethod |
2922 | 2898 |
def _DiagnoseByOS(rlist): |
2923 | 2899 |
"""Remaps a per-node return list into an a per-os per-node dictionary |
... | ... | |
3150 | 3126 |
# if we don't request only static fields, we need to lock the nodes |
3151 | 3127 |
self.needed_locks[locking.LEVEL_NODE] = self.wanted |
3152 | 3128 |
|
3153 |
def CheckPrereq(self): |
|
3154 |
"""Check prerequisites. |
|
3155 |
|
|
3156 |
""" |
|
3157 |
# The validation of the node list is done in the _GetWantedNodes, |
|
3158 |
# if non empty, and if empty, there's no validation to do |
|
3159 |
pass |
|
3160 |
|
|
3161 | 3129 |
def Exec(self, feedback_fn): |
3162 | 3130 |
"""Computes the list of nodes and their attributes. |
3163 | 3131 |
|
... | ... | |
3289 | 3257 |
self.needed_locks[locking.LEVEL_NODE] = \ |
3290 | 3258 |
_GetWantedNodes(self, self.op.nodes) |
3291 | 3259 |
|
3292 |
def CheckPrereq(self): |
|
3293 |
"""Check prerequisites. |
|
3294 |
|
|
3295 |
This checks that the fields required are valid output fields. |
|
3296 |
|
|
3297 |
""" |
|
3298 |
self.nodes = self.acquired_locks[locking.LEVEL_NODE] |
|
3299 |
|
|
3300 | 3260 |
def Exec(self, feedback_fn): |
3301 | 3261 |
"""Computes the list of nodes and their attributes. |
3302 | 3262 |
|
3303 | 3263 |
""" |
3304 |
nodenames = self.nodes
|
|
3264 |
nodenames = self.acquired_locks[locking.LEVEL_NODE]
|
|
3305 | 3265 |
volumes = self.rpc.call_node_volumes(nodenames) |
3306 | 3266 |
|
3307 | 3267 |
ilist = [self.cfg.GetInstanceInfo(iname) for iname |
... | ... | |
3379 | 3339 |
else: |
3380 | 3340 |
self.needed_locks[locking.LEVEL_NODE] = locking.ALL_SET |
3381 | 3341 |
|
3382 |
def CheckPrereq(self): |
|
3383 |
"""Check prerequisites. |
|
3384 |
|
|
3385 |
This checks that the fields required are valid output fields. |
|
3386 |
|
|
3387 |
""" |
|
3388 |
self.nodes = self.acquired_locks[locking.LEVEL_NODE] |
|
3389 |
|
|
3390 | 3342 |
def Exec(self, feedback_fn): |
3391 | 3343 |
"""Computes the list of nodes and their attributes. |
3392 | 3344 |
|
3393 | 3345 |
""" |
3346 |
self.nodes = self.acquired_locks[locking.LEVEL_NODE] |
|
3347 |
|
|
3394 | 3348 |
# Always get name to sort by |
3395 | 3349 |
if constants.SF_NAME in self.op.output_fields: |
3396 | 3350 |
fields = self.op.output_fields[:] |
... | ... | |
3912 | 3866 |
""" |
3913 | 3867 |
self.needed_locks = {} |
3914 | 3868 |
|
3915 |
def CheckPrereq(self): |
|
3916 |
"""Check prerequisites. |
|
3917 |
|
|
3918 |
This LU has no prereqs. |
|
3919 |
|
|
3920 |
""" |
|
3921 |
pass |
|
3922 |
|
|
3923 | 3869 |
def Exec(self, feedback_fn): |
3924 | 3870 |
"""Reboots a node. |
3925 | 3871 |
|
... | ... | |
3940 | 3886 |
def ExpandNames(self): |
3941 | 3887 |
self.needed_locks = {} |
3942 | 3888 |
|
3943 |
def CheckPrereq(self): |
|
3944 |
"""No prerequsites needed for this LU. |
|
3945 |
|
|
3946 |
""" |
|
3947 |
pass |
|
3948 |
|
|
3949 | 3889 |
def Exec(self, feedback_fn): |
3950 | 3890 |
"""Return cluster config. |
3951 | 3891 |
|
... | ... | |
4010 | 3950 |
def ExpandNames(self): |
4011 | 3951 |
self.needed_locks = {} |
4012 | 3952 |
|
4013 |
def CheckPrereq(self): |
|
4014 |
"""No prerequisites. |
|
4015 |
|
|
4016 |
""" |
|
4017 |
pass |
|
4018 |
|
|
4019 | 3953 |
def Exec(self, feedback_fn): |
4020 | 3954 |
"""Dump a representation of the cluster config to the standard output. |
4021 | 3955 |
|
... | ... | |
4957 | 4891 |
if level == locking.LEVEL_NODE and self.do_locking: |
4958 | 4892 |
self._LockInstancesNodes() |
4959 | 4893 |
|
4960 |
def CheckPrereq(self): |
|
4961 |
"""Check prerequisites. |
|
4962 |
|
|
4963 |
""" |
|
4964 |
pass |
|
4965 |
|
|
4966 | 4894 |
def Exec(self, feedback_fn): |
4967 | 4895 |
"""Computes the list of nodes and their attributes. |
4968 | 4896 |
|
... | ... | |
8081 | 8009 |
self.op.remote_node = _ExpandNodeName(self.cfg, self.op.remote_node) |
8082 | 8010 |
locks[locking.LEVEL_NODE] = self.op.nodes + [self.op.remote_node] |
8083 | 8011 |
|
8084 |
def CheckPrereq(self): |
|
8085 |
pass |
|
8086 |
|
|
8087 | 8012 |
def Exec(self, feedback_fn): |
8088 | 8013 |
if self.op.remote_node is not None: |
8089 | 8014 |
instances = [] |
... | ... | |
8251 | 8176 |
|
8252 | 8177 |
self.wanted_instances = [self.cfg.GetInstanceInfo(name) for name |
8253 | 8178 |
in self.wanted_names] |
8254 |
return |
|
8255 | 8179 |
|
8256 | 8180 |
def _ComputeBlockdevStatus(self, node, instance_name, dev): |
8257 | 8181 |
"""Returns the status of a block device |
... | ... | |
9048 | 8972 |
self.needed_locks[locking.LEVEL_NODE] = \ |
9049 | 8973 |
_GetWantedNodes(self, self.op.nodes) |
9050 | 8974 |
|
9051 |
def CheckPrereq(self): |
|
9052 |
"""Check prerequisites. |
|
9053 |
|
|
9054 |
""" |
|
9055 |
self.nodes = self.acquired_locks[locking.LEVEL_NODE] |
|
9056 |
|
|
9057 | 8975 |
def Exec(self, feedback_fn): |
9058 | 8976 |
"""Compute the list of all the exported system images. |
9059 | 8977 |
|
... | ... | |
9063 | 8981 |
that node. |
9064 | 8982 |
|
9065 | 8983 |
""" |
8984 |
self.nodes = self.acquired_locks[locking.LEVEL_NODE] |
|
9066 | 8985 |
rpcresult = self.rpc.call_export_list(self.nodes) |
9067 | 8986 |
result = {} |
9068 | 8987 |
for node in rpcresult: |
... | ... | |
9434 | 9353 |
# we can remove exports also for a removed instance) |
9435 | 9354 |
self.needed_locks[locking.LEVEL_NODE] = locking.ALL_SET |
9436 | 9355 |
|
9437 |
def CheckPrereq(self): |
|
9438 |
"""Check prerequisites. |
|
9439 |
""" |
|
9440 |
pass |
|
9441 |
|
|
9442 | 9356 |
def Exec(self, feedback_fn): |
9443 | 9357 |
"""Remove any export. |
9444 | 9358 |
|
... | ... | |
9651 | 9565 |
self.op.on_nodes = _GetWantedNodes(self, self.op.on_nodes) |
9652 | 9566 |
self.needed_locks[locking.LEVEL_NODE] = self.op.on_nodes |
9653 | 9567 |
|
9654 |
def CheckPrereq(self): |
|
9655 |
"""Check prerequisites. |
|
9656 |
|
|
9657 |
""" |
|
9658 |
|
|
9659 | 9568 |
def _TestDelay(self): |
9660 | 9569 |
"""Do the actual sleep. |
9661 | 9570 |
|
Also available in: Unified diff