Revision a9542a4f lib/bootstrap.py
b/lib/bootstrap.py | ||
---|---|---|
577 | 577 |
errors.ECODE_INVAL) |
578 | 578 |
|
579 | 579 |
# set up ssh config and /etc/hosts |
580 |
sshline = utils.ReadFile(pathutils.SSH_HOST_RSA_PUB) |
|
581 |
sshkey = sshline.split(" ")[1] |
|
580 |
rsa_sshkey = "" |
|
581 |
dsa_sshkey = "" |
|
582 |
if os.path.isfile(pathutils.SSH_HOST_RSA_PUB): |
|
583 |
sshline = utils.ReadFile(pathutils.SSH_HOST_RSA_PUB) |
|
584 |
rsa_sshkey = sshline.split(" ")[1] |
|
585 |
if os.path.isfile(pathutils.SSH_HOST_DSA_PUB): |
|
586 |
sshline = utils.ReadFile(pathutils.SSH_HOST_DSA_PUB) |
|
587 |
dsa_sshkey = sshline.split(" ")[1] |
|
588 |
if not rsa_sshkey and not dsa_sshkey: |
|
589 |
raise errors.OpPrereqError("Failed to find SSH public keys", |
|
590 |
errors.ECODE_ENVIRON) |
|
582 | 591 |
|
583 | 592 |
if modify_etc_hosts: |
584 | 593 |
utils.AddHostToEtcHosts(hostname.name, hostname.ip) |
... | ... | |
606 | 615 |
# init of cluster config file |
607 | 616 |
cluster_config = objects.Cluster( |
608 | 617 |
serial_no=1, |
609 |
rsahostkeypub=sshkey, |
|
618 |
rsahostkeypub=rsa_sshkey, |
|
619 |
dsahostkeypub=dsa_sshkey, |
|
610 | 620 |
highest_used_port=(constants.FIRST_DRBD_PORT - 1), |
611 | 621 |
mac_prefix=mac_prefix, |
612 | 622 |
volume_group_name=vg_name, |
Also available in: Unified diff