Hm, maybe it would make sense to give a hint how to achieve this
indirectly. "If you want to change the master capability flag for this
node, fail over the master role to another node first." (Just as a
suggestion, still LGTM.)

On Tue, 31 Mar 2015 at 09:33 Helga Velroyen <[email protected]> wrote:

> LGTM, thanks
>
> On Mon, 30 Mar 2015 at 15:43 'Klaus Aehlig' via ganeti-devel <
> [email protected]> wrote:
>
>> ...as the master node should never lose it's master capability.
>> Fixes issue 1023.
>>
>> Signed-off-by: Klaus Aehlig <[email protected]>
>> ---
>>  lib/cmdlib/node.py | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/lib/cmdlib/node.py b/lib/cmdlib/node.py
>> index 89a9aee..5b90ad3 100644
>> --- a/lib/cmdlib/node.py
>> +++ b/lib/cmdlib/node.py
>> @@ -647,6 +647,9 @@ class LUNodeSetParams(LogicalUnit):
>>
>>      # If we're no longer master capable, we'll demote ourselves from MC
>>      if self.op.master_capable is False and node.master_candidate:
>> +      if self.op.node_uuid == self.cfg.GetMasterNode():
>> +        raise errors.OpPrereqError("Master must remain master capable",
>> +                                   errors.ECODE_STATE)
>>        self.LogInfo("Demoting from master candidate")
>>        self.op.master_candidate = False
>>
>> --
>> 2.2.0.rc0.207.ga3a616c
>>
>>

Reply via email to