” Module for SettingProvider class.
Base of all LMI_*Setting providers. Every setting class can have:
- number of fixed preconfigured instances
- number of configurable persistent instances
- number of configurable in-memory (transient) instances
- instances associated to managed elements
This class provides all four instance types.
The setting itself is represented by dictionary of key -> value.
Preconfigured instances are stored in /etc/openlmi/storage/settings/<setting_classname>.ini Persistent instances are stored in /var/lib/openlmi-storage/settings/<setting_classname>.ini
setting_classname = name of CIM class, which we provide supported_properties = hash property_name -> constructor
constructor is a function which takes string argument and returns CIM value. (i.e. pywbem.Uint16 or bool or string etc).
Implements LMI_DiskPartitionConfigurationSetting.CloneSetting()
Create a copy of this instance. The resulting instance will have the same class and the same properties as the original instance except ChangeableType, which will be set to “Changeable - Transient” in the clone, and InstanceID.
Keyword arguments: env – Provider Environment (pycimmb.ProviderEnvironment) object_name – A pywbem.CIMInstanceName or pywbem.CIMCLassName
specifying the object on which the method CloneSetting() should be invoked.
Returns a two-tuple containing the return value (type pywbem.Uint32) and a list of CIMParameter objects representing the output parameters
Output parameters: Clone – (type REF (pywbem.CIMInstanceName(setting_classname=’CIM_StorageSetting’, ...))
Created copy.
Possible Errors: CIM_ERR_ACCESS_DENIED CIM_ERR_INVALID_PARAMETER (including missing, duplicate,
unrecognized or otherwise incorrect parameters)
CIM_ERR_FAILED (some other unspecified error occurred)
InstanceID should have format LMI:<classname>:<ID>. This method returns string LMI:<classname>:<myid>
Delete an instance.
Keyword arguments: env – Provider Environment (pycimmb.ProviderEnvironment) instance_name – A pywbem.CIMInstanceName specifying the instance
to delete.
Possible Errors: CIM_ERR_ACCESS_DENIED CIM_ERR_NOT_SUPPORTED CIM_ERR_INVALID_NAMESPACE CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
or otherwise incorrect parameters)
CIM_ERR_FAILED (some other unspecified error occurred)
Provider implementation of EnumerateInstances intrinsic method. Subclasses should not override this method, they should override enumerate_configurations only.
Enumerate all instances of LMI_*Setting, which are attached to managed elements, i.e. are not transient, persistent nor preconfigured.
This method returns iterabe with Setting instances.
Subclasses should override this method.
Find an Setting instance with given InstanceID and return it. Return None if there is no such instance.
Return CIMInstanceName for ElementSettingData association. Return None if no such element exist. Subclasses should override this method.
Return Setting instance for given instance_id. Return None if no such Setting is found.
Subclasses should override this method.
InstanceID should have format LMI:<classname>:<myid>. This method checks, that the format is OK and returns the myid. It returns None if the format is not OK. This method can be used in get_configuration_for_id.
Return a newly created or modified instance.
Keyword arguments: env – Provider Environment (pycimmb.ProviderEnvironment) instance – The new pywbem.CIMInstance. If modifying an existing
instance, the properties on this instance have been filtered by the PropertyList from the request.
modify_existing – True if ModifyInstance, False if CreateInstance
Return the new instance. The keys must be set on the new instance.
Possible Errors: CIM_ERR_ACCESS_DENIED CIM_ERR_NOT_SUPPORTED CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
or otherwise incorrect parameters)
CIM_ERR_FAILED (some other unspecified error occurred)
Convert a string to boolean value. ‘1’, ‘true’ and ‘True’ are True, the rest is False.
Convert a string to array of strings. The string must be enclosed in [].
Provider of LMI_*Setting class for managed element classes which implement SettingHelper.
Enumerate all instances of LMI_*Setting, which are attached to managed elements, i.e. are not transient, persistent nor preconfigured. It returns setting_helper.enumerate_settings.