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, __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]
 
UpgradeDiskTemplates(cls, ipolicy, enabled_disk_templates)
Upgrades the ipolicy configuration.
source code
 
CheckParameterSyntax(cls, ipolicy, check_std)
Check the instance policy for validity.
source code
 
_CheckIncompleteSpec(cls, spec, keyname) source code
 
CheckISpecSyntax(cls, ipolicy, check_std)
Check the instance policy specs for validity.
source code
bool
_CheckISpecParamSyntax(cls, minmaxspecs, stdspec, name, check_std)
Check the instance policy specs 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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

CheckParameterSyntax(cls, ipolicy, check_std)
Class Method

source code 

Check the instance policy for validity.

Parameters:
  • ipolicy (dict) - dictionary with min/max/std specs and policies
  • check_std (bool) - Whether to check std value or just assume compliance
Raises:

CheckISpecSyntax(cls, ipolicy, check_std)
Class Method

source code 

Check the instance policy specs for validity.

Parameters:
  • ipolicy (dict) - dictionary with min/max/std specs
  • check_std (bool) - Whether to check std value or just assume compliance
Raises:

_CheckISpecParamSyntax(cls, minmaxspecs, stdspec, name, check_std)
Class Method

source code 

Check the instance policy specs for validity on a given key.

We check if the instance specs makes sense for a given key, that is if minmaxspecs[min][name] <= stdspec[name] <= minmaxspec[max][name].

Parameters:
  • minmaxspecs (dict) - dictionary with min and max instance spec
  • stdspec (dict) - dictionary with standard instance spec
  • name (string) - what are the limits for
  • check_std (bool) - Whether to check std value or just assume compliance
Returns: bool
True when specs are valid, False when standard spec for the given name is not valid
Raises:

CheckParameter(cls, key, value)
Class Method

source code 

Checks a parameter.

Currently we expect all parameters to be float values.