Commit 186c03b3 authored by Andrea Spadaccini's avatar Andrea Spadaccini
Browse files

Fix cluster start failure due to missing netmask

If the cluster version is upgraded from a version before commit
5a8648eb

 to a version after that commit,
the master startup will fail because the ssconf file with the master
netmask will not be present, and it is read during the master voting
process.

This patch fixes this bug, making ssconf.GetMasterNetmask return a
default netmask value, and also corrects the docstring of this method.
Signed-off-by: default avatarAndrea Spadaccini <spadaccio@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent d24303b3
......@@ -413,10 +413,15 @@ class SimpleStore(object):
return self._ReadFile(constants.SS_MASTER_NETDEV)
def GetMasterNetmask(self):
"""Get the netdev to which we'll add the master ip.
"""Get the master netmask.
"""
return self._ReadFile(constants.SS_MASTER_NETMASK)
try:
return self._ReadFile(constants.SS_MASTER_NETMASK)
except errors.ConfigurationError:
family = self.GetPrimaryIPFamily()
ipcls = netutils.IPAddress.GetClassFromIpFamily(family)
return ipcls.iplen
def GetMasterNode(self):
"""Get the hostname of the master node for this cluster.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment