Package ganeti :: Module objects :: Class TaggableObject
[hide private]
[frames] | no frames]

Class TaggableObject

source code


An generic class supporting tags.

Instance Methods [hide private]
 
GetTags(self)
Return the tags list.
source code
 
AddTag(self, tag)
Add a new tag.
source code
 
RemoveTag(self, tag)
Remove a tag.
source code
 
ToDict(self, _with_private=False)
Taggable-object-specific conversion to standard python types.
source code

Inherited from ConfigObject: Copy, UpgradeConfig, Validate, __eq__, __getattr__, __getstate__, __repr__, __setstate__

Inherited from outils.ValidatedSlots: __init__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
ValidateTag(cls, tag)
Check if a tag is valid.
source code
 
FromDict(cls, val)
Custom function for instances.
source code

Inherited from outils.ValidatedSlots: GetAllSlots

Class Variables [hide private]
  VALID_TAG_RE = re.compile(r"^[\w.+*/:@-]+$")
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

ValidateTag(cls, tag)
Class Method

source code 

Check if a tag is valid.

If the tag is invalid, an errors.TagError will be raised. The function has no return value.

ToDict(self, _with_private=False)

source code 

Taggable-object-specific conversion to standard python types.

This replaces the tags set with a list.

Parameters:
  • _with_private - if True, the object will leak its private fields in the dictionary representation. If False, the values will be replaced with None.
Overrides: ConfigObject.ToDict

FromDict(cls, val)
Class Method

source code 

Custom function for instances.

Overrides: ConfigObject.FromDict