Revision 868a98ca
b/lib/config.py | ||
---|---|---|
827 | 827 |
""" |
828 | 828 |
return self._config_data.cluster.default_iallocator |
829 | 829 |
|
830 |
@locking.ssynchronized(_config_lock, shared=1) |
|
831 |
def GetPrimaryIPFamily(self): |
|
832 |
"""Get cluster primary ip family. |
|
833 |
|
|
834 |
@return: primary ip family |
|
835 |
|
|
836 |
""" |
|
837 |
return self._config_data.cluster.primary_ip_family |
|
838 |
|
|
830 | 839 |
@locking.ssynchronized(_config_lock) |
831 | 840 |
def AddInstance(self, instance, ec_id): |
832 | 841 |
"""Add an instance to the config. |
... | ... | |
1407 | 1416 |
constants.SS_NODE_SECONDARY_IPS: node_snd_ips_data, |
1408 | 1417 |
constants.SS_OFFLINE_NODES: off_data, |
1409 | 1418 |
constants.SS_ONLINE_NODES: on_data, |
1419 |
constants.SS_PRIMARY_IP_FAMILY: str(cluster.primary_ip_family), |
|
1410 | 1420 |
constants.SS_INSTANCE_LIST: instance_data, |
1411 | 1421 |
constants.SS_RELEASE_VERSION: constants.RELEASE_VERSION, |
1412 | 1422 |
constants.SS_HYPERVISOR_LIST: hypervisor_list, |
b/lib/constants.py | ||
---|---|---|
871 | 871 |
SS_NODE_SECONDARY_IPS = "node_secondary_ips" |
872 | 872 |
SS_OFFLINE_NODES = "offline_nodes" |
873 | 873 |
SS_ONLINE_NODES = "online_nodes" |
874 |
SS_PRIMARY_IP_FAMILY = "primary_ip_family" |
|
874 | 875 |
SS_INSTANCE_LIST = "instance_list" |
875 | 876 |
SS_RELEASE_VERSION = "release_version" |
876 | 877 |
SS_HYPERVISOR_LIST = "hypervisor_list" |
b/lib/ssconf.py | ||
---|---|---|
281 | 281 |
constants.SS_NODE_SECONDARY_IPS, |
282 | 282 |
constants.SS_OFFLINE_NODES, |
283 | 283 |
constants.SS_ONLINE_NODES, |
284 |
constants.SS_PRIMARY_IP_FAMILY, |
|
284 | 285 |
constants.SS_INSTANCE_LIST, |
285 | 286 |
constants.SS_RELEASE_VERSION, |
286 | 287 |
constants.SS_HYPERVISOR_LIST, |
... | ... | |
460 | 461 |
data = self._ReadFile(constants.SS_UID_POOL) |
461 | 462 |
return data |
462 | 463 |
|
464 |
def GetPrimaryIPFamily(self): |
|
465 |
"""Return the cluster-wide primary address family. |
|
466 |
|
|
467 |
""" |
|
468 |
try: |
|
469 |
return int(self._ReadFile(constants.SS_PRIMARY_IP_FAMILY)) |
|
470 |
except (ValueError, TypeError), err: |
|
471 |
raise errors.ConfigurationError("Error while trying to parse primary ip" |
|
472 |
" family: %s" % err) |
|
473 |
|
|
463 | 474 |
|
464 | 475 |
def GetMasterAndMyself(ss=None): |
465 | 476 |
"""Get the master node and my own hostname. |
Also available in: Unified diff