Revision ec29fe40 lib/objects.py

b/lib/objects.py
148 148
    return ConfigObject.Load(StringIO(data))
149 149

  
150 150

  
151
class TaggableObject(object):
151
class TaggableObject(ConfigObject):
152 152
  """An generic class supporting tags.
153 153

  
154 154
  """
155
  __slots__ = []
155
  __slots__ = ConfigObject.__slots__ + ["tags"]
156 156

  
157 157
  @staticmethod
158 158
  def ValidateTag(tag):
......
287 287
    return result
288 288

  
289 289

  
290
class Instance(ConfigObject, TaggableObject):
290
class Instance(TaggableObject):
291 291
  """Config object representing an instance."""
292
  __slots__ = [
292
  __slots__ = TaggableObject.__slots__ + [
293 293
    "name",
294 294
    "primary_node",
295 295
    "os",
......
299 299
    "nics",
300 300
    "disks",
301 301
    "disk_template",
302
    "tags",
303 302
    ]
304 303

  
305 304
  def _ComputeSecondaryNodes(self):
......
407 406
    ]
408 407

  
409 408

  
410
class Node(ConfigObject, TaggableObject):
409
class Node(TaggableObject):
411 410
  """Config object representing a node."""
412
  __slots__ = ["name", "primary_ip", "secondary_ip", "tags"]
411
  __slots__ = TaggableObject.__slots__ + [
412
    "name",
413
    "primary_ip",
414
    "secondary_ip",
415
    ]
413 416

  
414 417

  
415
class Cluster(ConfigObject, TaggableObject):
418
class Cluster(TaggableObject):
416 419
  """Config object representing the cluster."""
417
  __slots__ = [
420
  __slots__ = TaggableObject.__slots__ + [
418 421
    "config_version",
419 422
    "serial_no",
420 423
    "rsahostkeypub",
......
423 426
    "mac_prefix",
424 427
    "volume_group_name",
425 428
    "default_bridge",
426
    "tags",
427 429
    ]
428 430

  
429 431

  

Also available in: Unified diff