Revision b86a6bcd
b/lib/bootstrap.py | ||
---|---|---|
123 | 123 |
def InitCluster(cluster_name, mac_prefix, def_bridge, |
124 | 124 |
master_netdev, file_storage_dir, candidate_pool_size, |
125 | 125 |
secondary_ip=None, vg_name=None, beparams=None, hvparams=None, |
126 |
enabled_hypervisors=None, default_hypervisor=None): |
|
126 |
enabled_hypervisors=None, default_hypervisor=None, |
|
127 |
modify_etc_hosts=True): |
|
127 | 128 |
"""Initialise the cluster. |
128 | 129 |
|
129 | 130 |
@type candidate_pool_size: int |
... | ... | |
225 | 226 |
f.close() |
226 | 227 |
sshkey = sshline.split(" ")[1] |
227 | 228 |
|
228 |
utils.AddHostToEtcHosts(hostname.name) |
|
229 |
if modify_etc_hosts: |
|
230 |
utils.AddHostToEtcHosts(hostname.name) |
|
231 |
|
|
229 | 232 |
_InitSSHSetup() |
230 | 233 |
|
231 | 234 |
# init of cluster config file |
... | ... | |
247 | 250 |
beparams={constants.BEGR_DEFAULT: beparams}, |
248 | 251 |
hvparams=hvparams, |
249 | 252 |
candidate_pool_size=candidate_pool_size, |
253 |
modify_etc_hosts=opts.modify_etc_hosts, |
|
250 | 254 |
) |
251 | 255 |
master_node_config = objects.Node(name=hostname.name, |
252 | 256 |
primary_ip=hostname.ip, |
b/lib/cmdlib.py | ||
---|---|---|
2265 | 2265 |
" new node: %s" % msg) |
2266 | 2266 |
|
2267 | 2267 |
# Add node to our /etc/hosts, and add key to known_hosts |
2268 |
utils.AddHostToEtcHosts(new_node.name) |
|
2268 |
if self.cfg.GetClusterInfo().modify_etc_hosts: |
|
2269 |
utils.AddHostToEtcHosts(new_node.name) |
|
2269 | 2270 |
|
2270 | 2271 |
if new_node.secondary_ip != new_node.primary_ip: |
2271 | 2272 |
result = self.rpc.call_node_has_ip_address(new_node.name, |
b/lib/objects.py | ||
---|---|---|
735 | 735 |
"hvparams", |
736 | 736 |
"beparams", |
737 | 737 |
"candidate_pool_size", |
738 |
"modify_etc_hosts", |
|
738 | 739 |
] |
739 | 740 |
|
741 |
def UpgradeConfig(self): |
|
742 |
"""Fill defaults for missing configuration values. |
|
743 |
|
|
744 |
""" |
|
745 |
if self.modify_etc_hosts is None: |
|
746 |
self.modify_etc_hosts = True |
|
747 |
|
|
740 | 748 |
def ToDict(self): |
741 | 749 |
"""Custom function for cluster. |
742 | 750 |
|
b/scripts/gnt-cluster | ||
---|---|---|
110 | 110 |
hvparams=hvparams, |
111 | 111 |
beparams=beparams, |
112 | 112 |
candidate_pool_size=opts.candidate_pool_size, |
113 |
modify_etc_hosts=opts.modify_etc_hosts, |
|
113 | 114 |
) |
114 | 115 |
return 0 |
115 | 116 |
|
... | ... | |
565 | 566 |
help="No support for lvm based instances" |
566 | 567 |
" (cluster-wide)", |
567 | 568 |
action="store_false", default=True,), |
569 |
make_option("--no-etc-hosts", dest="modify_etc_hosts", |
|
570 |
help="Don't modify /etc/hosts" |
|
571 |
" (cluster-wide)", |
|
572 |
action="store_false", default=True,), |
|
568 | 573 |
make_option("--enabled-hypervisors", dest="enabled_hypervisors", |
569 | 574 |
help="Comma-separated list of hypervisors", |
570 | 575 |
type="string", default=None), |
Also available in: Unified diff