Revision 8d4c25f2 lib/objects.py

b/lib/objects.py
395 395
    "nodegroups",
396 396
    "instances",
397 397
    "networks",
398
    "disks",
398 399
    "serial_no",
399 400
    ] + _TIMESTAMPS
400 401

  
401 402
  def ToDict(self, _with_private=False):
402 403
    """Custom function for top-level config data.
403 404

  
404
    This just replaces the list of instances, nodes and the cluster
405
    with standard python types.
405
    This just replaces the list of nodes, instances, nodegroups,
406
    networks, disks and the cluster with standard python types.
406 407

  
407 408
    """
408 409
    mydict = super(ConfigData, self).ToDict(_with_private=_with_private)
409 410
    mydict["cluster"] = mydict["cluster"].ToDict()
410
    for key in "nodes", "instances", "nodegroups", "networks":
411
    for key in "nodes", "instances", "nodegroups", "networks", "disks":
411 412
      mydict[key] = outils.ContainerToDicts(mydict[key])
412 413

  
413 414
    return mydict
......
425 426
    obj.nodegroups = \
426 427
      outils.ContainerFromDicts(obj.nodegroups, dict, NodeGroup)
427 428
    obj.networks = outils.ContainerFromDicts(obj.networks, dict, Network)
429
    obj.disks = outils.ContainerFromDicts(obj.disks, dict, Disk)
428 430
    return obj
429 431

  
430 432
  def HasAnyDiskOfType(self, dev_type):
......
465 467
      self.networks = {}
466 468
    for network in self.networks.values():
467 469
      network.UpgradeConfig()
470
    for disk in self.disks.values():
471
      disk.UpgradeConfig()
468 472

  
469 473
  def _UpgradeEnabledDiskTemplates(self):
470 474
    """Upgrade the cluster's enabled disk templates by inspecting the currently

Also available in: Unified diff