Revision 0fcc5db3
b/lib/cmdlib.py | ||
---|---|---|
2070 | 2070 |
REQ_BGL = False |
2071 | 2071 |
|
2072 | 2072 |
def ExpandNames(self): |
2073 |
if self.op.reboot_type not in [constants.INSTANCE_REBOOT_SOFT, |
|
2074 |
constants.INSTANCE_REBOOT_HARD, |
|
2075 |
constants.INSTANCE_REBOOT_FULL]: |
|
2076 |
raise errors.ParameterError("reboot type not in [%s, %s, %s]" % |
|
2077 |
(constants.INSTANCE_REBOOT_SOFT, |
|
2078 |
constants.INSTANCE_REBOOT_HARD, |
|
2079 |
constants.INSTANCE_REBOOT_FULL)) |
|
2073 | 2080 |
self._ExpandAndLockInstance() |
2074 | 2081 |
self.needed_locks[locking.LEVEL_NODE] = [] |
2075 | 2082 |
self.recalculate_locks[locking.LEVEL_NODE] = 'replace' |
2076 | 2083 |
|
2077 | 2084 |
def DeclareLocks(self, level): |
2078 | 2085 |
if level == locking.LEVEL_NODE: |
2086 |
# FIXME: lock only primary on (not constants.INSTANCE_REBOOT_FULL) |
|
2079 | 2087 |
self._LockInstancesNodes() |
2080 | 2088 |
|
2081 | 2089 |
def BuildHooksEnv(self): |
... | ... | |
2116 | 2124 |
|
2117 | 2125 |
node_current = instance.primary_node |
2118 | 2126 |
|
2119 |
if reboot_type not in [constants.INSTANCE_REBOOT_SOFT, |
|
2120 |
constants.INSTANCE_REBOOT_HARD, |
|
2121 |
constants.INSTANCE_REBOOT_FULL]: |
|
2122 |
raise errors.ParameterError("reboot type not in [%s, %s, %s]" % |
|
2123 |
(constants.INSTANCE_REBOOT_SOFT, |
|
2124 |
constants.INSTANCE_REBOOT_HARD, |
|
2125 |
constants.INSTANCE_REBOOT_FULL)) |
|
2126 |
|
|
2127 | 2127 |
if reboot_type in [constants.INSTANCE_REBOOT_SOFT, |
2128 | 2128 |
constants.INSTANCE_REBOOT_HARD]: |
2129 | 2129 |
if not rpc.call_instance_reboot(node_current, instance, |
Also available in: Unified diff