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

Class InstancePolicy

source code


Config object representing instance policy limits dictionary.

Note that this object is not actually used in the config, it's just used as a placeholder for a few functions.

Instance Methods [hide private]

Inherited from ConfigObject: Copy, ToDict, UpgradeConfig, Validate, __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]
 
CheckParameterSyntax(cls, ipolicy, check_std)
Check the instance policy for validity.
source code
 
CheckISpecSyntax(cls, ipolicy, name, check_std)
Check the instance policy for validity on a given key.
source code
 
CheckDiskTemplates(cls, disk_templates)
Checks the disk templates for validity.
source code
 
CheckParameter(cls, key, value)
Checks a parameter.
source code

Inherited from ConfigObject: FromDict

Inherited from outils.ValidatedSlots: GetAllSlots

Static Methods [hide private]
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

CheckISpecSyntax(cls, ipolicy, name, check_std)
Class Method

source code 

Check the instance policy for validity on a given key.

We check if the instance policy makes sense for a given key, that is if ipolicy[min][name] <= ipolicy[std][name] <= ipolicy[max][name].

Parameters:
  • ipolicy (dict) - dictionary with min, max, std specs
  • name (string) - what are the limits for
  • check_std (bool) - Whether to check std value or just assume compliance
Raises:
  • errors.ConfigureError - when specs for given name are not valid

CheckParameter(cls, key, value)
Class Method

source code 

Checks a parameter.

Currently we expect all parameters to be float values.