Revision e969a81f test/py/cmdlib/testsupport/config_mock.py

b/test/py/cmdlib/testsupport/config_mock.py
22 22
"""Support for mocking the cluster configuration"""
23 23

  
24 24

  
25
import time
25 26
import uuid as uuid_module
26 27

  
27 28
from ganeti import config
......
78 79
    if name is None:
79 80
      name = "mock_group_%d" % group_id
80 81
    if networks is None:
81
      networks = []
82
      networks = {}
82 83

  
83 84
    group = objects.NodeGroup(uuid=uuid,
84 85
                              name=name,
......
135 136
      group = self._default_group.uuid
136 137
    if isinstance(group, objects.NodeGroup):
137 138
      group = group.uuid
139
    if ndparams is None:
140
      ndparams = {}
138 141

  
139 142
    node = objects.Node(uuid=uuid,
140 143
                        name=name,
......
233 236
      serial_no=1,
234 237
      rsahostkeypub="",
235 238
      highest_used_port=(constants.FIRST_DRBD_PORT - 1),
239
      tcpudp_port_pool=set(),
236 240
      mac_prefix="aa:00:00",
237 241
      volume_group_name="xenvg",
242
      reserved_lvs=None,
238 243
      drbd_usermode_helper="/bin/true",
239
      nicparams={constants.PP_DEFAULT: constants.NICC_DEFAULTS},
240
      ndparams=constants.NDC_DEFAULTS,
241
      tcpudp_port_pool=set(),
242
      enabled_hypervisors=[constants.HT_FAKE],
243 244
      master_node=master_node_uuid,
244 245
      master_ip="192.168.0.254",
245 246
      master_netdev=constants.DEFAULT_BRIDGE,
247
      master_netmask=None,
248
      use_external_mip_script=None,
246 249
      cluster_name="cluster.example.com",
247 250
      file_storage_dir="/tmp",
248
      uid_pool=[],
251
      shared_file_storage_dir=None,
252
      enabled_hypervisors=list(constants.HYPER_TYPES),
253
      hvparams=None,
254
      ipolicy=None,
255
      os_hvp=None,
256
      beparams=None,
257
      osparams=None,
258
      nicparams=None,
259
      ndparams=None,
260
      diskparams=None,
261
      candidate_pool_size=3,
262
      modify_etc_hosts=False,
263
      modify_ssh_setup=False,
264
      maintain_node_health=False,
265
      uid_pool=None,
266
      default_iallocator=None,
267
      hidden_os=None,
268
      blacklisted_os=None,
269
      primary_ip_family=None,
270
      prealloc_wipe_disks=None,
271
      enabled_disk_templates=list(constants.DISK_TEMPLATES),
249 272
      )
273
    self._cluster.ctime = self._cluster.mtime = time.time()
274
    self._cluster.UpgradeConfig()
250 275
    self._config_data.cluster = self._cluster
251 276

  
252 277
    self._default_group = self.AddNewNodeGroup(name="default")

Also available in: Unified diff