Revision 5fcdc80d lib/config.py
b/lib/config.py | ||
---|---|---|
483 | 483 |
self._DistributeConfig() |
484 | 484 |
|
485 | 485 |
def InitConfig(self, node, primary_ip, secondary_ip, |
486 |
clustername, hostkeypub, mac_prefix, vg_name, def_bridge):
|
|
486 |
hostkeypub, mac_prefix, vg_name, def_bridge): |
|
487 | 487 |
"""Create the initial cluster configuration. |
488 | 488 |
|
489 | 489 |
It will contain the current node, which will also be the master |
... | ... | |
493 | 493 |
node: the nodename of the initial node |
494 | 494 |
primary_ip: the IP address of the current host |
495 | 495 |
secondary_ip: the secondary IP of the current host or None |
496 |
clustername: the name of the cluster |
|
497 | 496 |
hostkeypub: the public hostkey of this host |
498 | 497 |
|
499 | 498 |
""" |
500 | 499 |
hu_port = constants.FIRST_DRBD_PORT - 1 |
501 | 500 |
globalconfig = objects.Cluster(config_version=constants.CONFIG_VERSION, |
502 | 501 |
serial_no=1, |
503 |
name=clustername, |
|
504 | 502 |
rsahostkeypub=hostkeypub, |
505 | 503 |
highest_used_port=hu_port, |
506 | 504 |
mac_prefix=mac_prefix, |
... | ... | |
517 | 515 |
cluster=globalconfig) |
518 | 516 |
self._WriteConfig() |
519 | 517 |
|
520 |
def GetClusterName(self): |
|
521 |
"""Return the cluster name. |
|
522 |
|
|
523 |
""" |
|
524 |
self._OpenConfig() |
|
525 |
self._ReleaseLock() |
|
526 |
return self._config_data.cluster.name |
|
527 |
|
|
528 | 518 |
def GetVGName(self): |
529 | 519 |
"""Return the volume group name. |
530 | 520 |
|
Also available in: Unified diff