Revision 0389c42a
b/lib/cmdlib.py | ||
---|---|---|
10359 | 10359 |
|
10360 | 10360 |
# Verify the cluster would not be left group-less. |
10361 | 10361 |
if len(self.cfg.GetNodeGroupList()) == 1: |
10362 |
raise errors.OpPrereqError("Group '%s' is the last group in the cluster,"
|
|
10363 |
" which cannot be left without at least one"
|
|
10364 |
" group" % self.op.group_name,
|
|
10362 |
raise errors.OpPrereqError("Group '%s' is the only group,"
|
|
10363 |
" cannot be removed" %
|
|
10364 |
self.op.group_name, |
|
10365 | 10365 |
errors.ECODE_STATE) |
10366 | 10366 |
|
10367 | 10367 |
def BuildHooksEnv(self): |
b/lib/config.py | ||
---|---|---|
916 | 916 |
if group_uuid not in self._config_data.nodegroups: |
917 | 917 |
raise errors.ConfigurationError("Unknown node group '%s'" % group_uuid) |
918 | 918 |
|
919 |
assert len(self._config_data.nodegroups) != 1, \ |
|
920 |
"Group '%s' is the only group, cannot be removed" % group_uuid |
|
921 |
|
|
919 | 922 |
del self._config_data.nodegroups[group_uuid] |
920 | 923 |
self._config_data.cluster.serial_no += 1 |
921 | 924 |
self._WriteConfig() |
Also available in: Unified diff