Revision b9eeeb02 lib/bootstrap.py
b/lib/bootstrap.py | ||
---|---|---|
35 | 35 |
from ganeti import errors |
36 | 36 |
from ganeti import config |
37 | 37 |
from ganeti import constants |
38 |
from ganeti import objects |
|
38 | 39 |
from ganeti import ssconf |
39 | 40 |
|
40 | 41 |
|
... | ... | |
149 | 150 |
raise errors.OpPrereqError("You gave %s as secondary IP," |
150 | 151 |
" but it does not belong to this host." % |
151 | 152 |
secondary_ip) |
153 |
else: |
|
154 |
secondary_ip = hostname.ip |
|
152 | 155 |
|
153 | 156 |
if vg_name is not None: |
154 | 157 |
# Check if volume group is valid |
... | ... | |
219 | 222 |
_InitSSHSetup(hostname.name) |
220 | 223 |
|
221 | 224 |
# init of cluster config file |
225 |
cluster_config = objects.Cluster( |
|
226 |
serial_no=1, |
|
227 |
rsahostkeypub=sshkey, |
|
228 |
highest_used_port=(constants.FIRST_DRBD_PORT - 1), |
|
229 |
mac_prefix=mac_prefix, |
|
230 |
volume_group_name=vg_name, |
|
231 |
default_bridge=def_bridge, |
|
232 |
tcpudp_port_pool=set(), |
|
233 |
) |
|
234 |
master_node_config = objects.Node(name=hostname.name, |
|
235 |
primary_ip=hostname.ip, |
|
236 |
secondary_ip=secondary_ip) |
|
222 | 237 |
cfg = config.ConfigWriter() |
223 |
cfg.InitConfig(hostname.name, hostname.ip, secondary_ip, sshkey, |
|
224 |
mac_prefix, vg_name, def_bridge) |
|
238 |
cfg.InitConfig(cluster_config, master_node_config) |
|
225 | 239 |
|
226 | 240 |
ssh.WriteKnownHostsFile(cfg, ss, constants.SSH_KNOWN_HOSTS_FILE) |
227 | 241 |
|
Also available in: Unified diff