Revision f6bd6e98 test/ganeti.config_unittest.py
b/test/ganeti.config_unittest.py | ||
---|---|---|
55 | 55 |
|
56 | 56 |
def _init_cluster(self, cfg): |
57 | 57 |
"""Initializes the cfg object""" |
58 |
me = utils.HostInfo() |
|
59 |
ip = constants.LOCALHOST_IP_ADDRESS |
|
60 |
|
|
58 | 61 |
cluster_config = objects.Cluster( |
59 | 62 |
serial_no=1, |
60 | 63 |
rsahostkeypub="", |
... | ... | |
63 | 66 |
volume_group_name="xenvg", |
64 | 67 |
default_bridge=constants.DEFAULT_BRIDGE, |
65 | 68 |
tcpudp_port_pool=set(), |
69 |
hypervisor=constants.HT_FAKE, |
|
70 |
master_node=me.name, |
|
71 |
master_ip="127.0.0.1", |
|
72 |
master_netdev=constants.DEFAULT_BRIDGE, |
|
73 |
cluster_name="cluster.local", |
|
74 |
file_storage_dir="/tmp", |
|
66 | 75 |
) |
67 |
ip = constants.LOCALHOST_IP_ADDRESS |
|
68 |
master_node_config = objects.Node(name=utils.HostInfo().name,
|
|
69 |
primary_ip=ip, |
|
76 |
|
|
77 |
master_node_config = objects.Node(name=me.name,
|
|
78 |
primary_ip=me.ip,
|
|
70 | 79 |
secondary_ip=ip) |
71 |
cfg.InitConfig(cluster_config, master_node_config) |
|
80 |
|
|
81 |
cfg.InitConfig(constants.CONFIG_VERSION, |
|
82 |
cluster_config, master_node_config) |
|
72 | 83 |
|
73 | 84 |
def _create_instance(self): |
74 | 85 |
"""Create and return an instance object""" |
Also available in: Unified diff