def GetMasterNetdev(self):
return self._config_data["cluster"]["master_netdev"]
+ def GetMasterNetmask(self):
+ return self._config_data["cluster"]["master_netmask"]
+
def GetFileStorageDir(self):
return self._config_data["cluster"]["file_storage_dir"]
constants.SS_MASTER_CANDIDATES_IPS,
constants.SS_MASTER_IP,
constants.SS_MASTER_NETDEV,
+ constants.SS_MASTER_NETMASK,
constants.SS_MASTER_NODE,
constants.SS_NODE_LIST,
constants.SS_NODE_PRIMARY_IPS,
if len(value) > self._MAX_SIZE:
raise errors.ConfigurationError("ssconf file %s above maximum size" %
name)
- utils.WriteFile(self.KeyToFilename(name), data=value, mode=0444)
+ utils.WriteFile(self.KeyToFilename(name), data=value,
+ mode=constants.SS_FILE_PERMS)
finally:
ssconf_lock.Unlock()
"""
return self._ReadFile(constants.SS_MASTER_NETDEV)
+ def GetMasterNetmask(self):
+ """Get the 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.