summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2013-07-06 21:45:06 +0200
committerMichal Minar <miminar@redhat.com>2013-07-23 13:52:35 +0200
commit56610bea26c18d6aae110724b450f8f894595714 (patch)
tree8f64f45809e84e7136fc834702c0e0def9ff39df /src
parent9618e135bf2e54dea9679e943215d055f73c4375 (diff)
downloadopenlmi-providers-56610bea26c18d6aae110724b450f8f894595714.tar.gz
openlmi-providers-56610bea26c18d6aae110724b450f8f894595714.tar.xz
openlmi-providers-56610bea26c18d6aae110724b450f8f894595714.zip
software: added doc strings; spaces, be gone
removed spaces at the end of lines
Diffstat (limited to 'src')
-rw-r--r--src/software/lmi/software/LMI_AssociatedSoftwareJobMethodResult.py2
-rw-r--r--src/software/lmi/software/LMI_OwningSoftwareJobElement.py98
-rw-r--r--src/software/lmi/software/LMI_SoftwareIdentityChecks.py2
-rw-r--r--src/software/lmi/software/LMI_SoftwareIdentityFileCheck.py1
-rw-r--r--src/software/lmi/software/cimom_entry.py24
-rw-r--r--src/software/lmi/software/core/IdentityFileCheck.py16
-rw-r--r--src/software/lmi/software/core/InstallationServiceCapabilities.py2
-rw-r--r--src/software/lmi/software/yumdb/jobs.py2
-rw-r--r--src/software/lmi/software/yumdb/process.py2
-rwxr-xr-xsrc/software/test/test_software_identity_file_check.py2
10 files changed, 77 insertions, 74 deletions
diff --git a/src/software/lmi/software/LMI_AssociatedSoftwareJobMethodResult.py b/src/software/lmi/software/LMI_AssociatedSoftwareJobMethodResult.py
index 9155060..74cfb84 100644
--- a/src/software/lmi/software/LMI_AssociatedSoftwareJobMethodResult.py
+++ b/src/software/lmi/software/LMI_AssociatedSoftwareJobMethodResult.py
@@ -51,7 +51,7 @@ def generate_result_referents(_env, object_name, model, _keys_only):
model["Job"] = Job.job2model(job)
model["JobParameters"] = MethodResult.job2model(job)
yield model
-
+
class LMI_AssociatedSoftwareJobMethodResult(CIMProvider2):
"""Instrument the CIM class LMI_AssociatedSoftwareJobMethodResult
diff --git a/src/software/lmi/software/LMI_OwningSoftwareJobElement.py b/src/software/lmi/software/LMI_OwningSoftwareJobElement.py
index 06c8e88..2c59955 100644
--- a/src/software/lmi/software/LMI_OwningSoftwareJobElement.py
+++ b/src/software/lmi/software/LMI_OwningSoftwareJobElement.py
@@ -30,7 +30,7 @@ from lmi.software.util import cmpi_logging
from lmi.software.yumdb import YumDB
class LMI_OwningSoftwareJobElement(CIMProvider2):
- """Instrument the CIM class LMI_OwningSoftwareJobElement
+ """Instrument the CIM class LMI_OwningSoftwareJobElement
OwningJobElement represents an association between a Job and the
ManagedElement responsible for the creation of the Job. This
@@ -50,19 +50,19 @@ class LMI_OwningSoftwareJobElement(CIMProvider2):
Keyword arguments:
env -- Provider Environment (pycimmb.ProviderEnvironment)
- model -- A template of the pywbem.CIMInstance to be returned. The
- key properties are set on this instance to correspond to the
+ model -- A template of the pywbem.CIMInstance to be returned. The
+ key properties are set on this instance to correspond to the
instanceName that was requested. The properties of the model
- are already filtered according to the PropertyList from the
+ are already filtered according to the PropertyList from the
request. Only properties present in the model need to be
- given values. If you prefer, you can set all of the
- values, and the instance will be filtered for you.
+ given values. If you prefer, you can set all of the
+ values, and the instance will be filtered for you.
Possible Errors:
CIM_ERR_ACCESS_DENIED
- CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
or otherwise incorrect parameters)
- CIM_ERR_NOT_FOUND (the CIM Class does exist, but the requested CIM
+ CIM_ERR_NOT_FOUND (the CIM Class does exist, but the requested CIM
Instance does not exist in the specified namespace)
CIM_ERR_FAILED (some other unspecified error occurred)
"""
@@ -77,17 +77,17 @@ class LMI_OwningSoftwareJobElement(CIMProvider2):
"""Enumerate instances.
The WBEM operations EnumerateInstances and EnumerateInstanceNames
- are both mapped to this method.
+ are both mapped to this method.
This method is a python generator
Keyword arguments:
env -- Provider Environment (pycimmb.ProviderEnvironment)
- model -- A template of the pywbem.CIMInstances to be generated.
- The properties of the model are already filtered according to
- the PropertyList from the request. Only properties present in
- the model need to be given values. If you prefer, you can
- always set all of the values, and the instance will be filtered
- for you.
+ model -- A template of the pywbem.CIMInstances to be generated.
+ The properties of the model are already filtered according to
+ the PropertyList from the request. Only properties present in
+ the model need to be given values. If you prefer, you can
+ always set all of the values, and the instance will be filtered
+ for you.
keys_only -- A boolean. True if only the key properties should be
set on the generated instances.
@@ -99,29 +99,29 @@ class LMI_OwningSoftwareJobElement(CIMProvider2):
for job in YumDB.get_instance().get_job_list():
model['OwnedElement'] = Job.job2model(job)
yield model
-
+
@cmpi_logging.trace_method
def set_instance(self, env, instance, modify_existing):
"""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
+ 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.
+ 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
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
or otherwise incorrect parameters)
- CIM_ERR_ALREADY_EXISTS (the CIM Instance already exists -- only
+ CIM_ERR_ALREADY_EXISTS (the CIM Instance already exists -- only
valid if modify_existing is False, indicating that the operation
was CreateInstance)
- CIM_ERR_NOT_FOUND (the CIM Instance does not exist -- only valid
+ CIM_ERR_NOT_FOUND (the CIM Instance does not exist -- only valid
if modify_existing is True, indicating that the operation
was ModifyInstance)
CIM_ERR_FAILED (some other unspecified error occurred)
@@ -134,61 +134,61 @@ class LMI_OwningSoftwareJobElement(CIMProvider2):
Keyword arguments:
env -- Provider Environment (pycimmb.ProviderEnvironment)
- instance_name -- A pywbem.CIMInstanceName specifying the instance
+ 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
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
or otherwise incorrect parameters)
- CIM_ERR_INVALID_CLASS (the CIM Class does not exist in the specified
+ CIM_ERR_INVALID_CLASS (the CIM Class does not exist in the specified
namespace)
- CIM_ERR_NOT_FOUND (the CIM Class does exist, but the requested CIM
+ CIM_ERR_NOT_FOUND (the CIM Class does exist, but the requested CIM
Instance does not exist in the specified namespace)
CIM_ERR_FAILED (some other unspecified error occurred)
- """
+ """
raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED)
-
+
@cmpi_logging.trace_method
def references(self, env, object_name, model, result_class_name, role,
result_role, keys_only):
"""Instrument Associations.
- All four association-related operations (Associators, AssociatorNames,
- References, ReferenceNames) are mapped to this method.
+ All four association-related operations (Associators, AssociatorNames,
+ References, ReferenceNames) are mapped to this method.
This method is a python generator
Keyword arguments:
env -- Provider Environment (pycimmb.ProviderEnvironment)
- object_name -- A pywbem.CIMInstanceName that defines the source
+ object_name -- A pywbem.CIMInstanceName that defines the source
CIM Object whose associated Objects are to be returned.
model -- A template pywbem.CIMInstance to serve as a model
of the objects to be returned. Only properties present on this
- model need to be set.
- result_class_name -- If not empty, this string acts as a filter on
- the returned set of Instances by mandating that each returned
- Instances MUST represent an association between object_name
+ model need to be set.
+ result_class_name -- If not empty, this string acts as a filter on
+ the returned set of Instances by mandating that each returned
+ Instances MUST represent an association between object_name
and an Instance of a Class whose name matches this parameter
- or a subclass.
- role -- If not empty, MUST be a valid Property name. It acts as a
- filter on the returned set of Instances by mandating that each
- returned Instance MUST refer to object_name via a Property
+ or a subclass.
+ role -- If not empty, MUST be a valid Property name. It acts as a
+ filter on the returned set of Instances by mandating that each
+ returned Instance MUST refer to object_name via a Property
whose name matches the value of this parameter.
- result_role -- If not empty, MUST be a valid Property name. It acts
- as a filter on the returned set of Instances by mandating that
- each returned Instance MUST represent associations of
- object_name to other Instances, where the other Instances play
- the specified result_role in the association (i.e. the
- name of the Property in the Association Class that refers to
- the Object related to object_name MUST match the value of this
+ result_role -- If not empty, MUST be a valid Property name. It acts
+ as a filter on the returned set of Instances by mandating that
+ each returned Instance MUST represent associations of
+ object_name to other Instances, where the other Instances play
+ the specified result_role in the association (i.e. the
+ name of the Property in the Association Class that refers to
+ the Object related to object_name MUST match the value of this
parameter).
keys_only -- A boolean. True if only the key properties should be
set on the generated instances.
- The following diagram may be helpful in understanding the role,
+ The following diagram may be helpful in understanding the role,
result_role, and result_class_name parameters.
+------------------------+ +-------------------+
| object_name.classname | | result_class_name |
@@ -206,13 +206,13 @@ class LMI_OwningSoftwareJobElement(CIMProvider2):
CIM_ERR_ACCESS_DENIED
CIM_ERR_NOT_SUPPORTED
CIM_ERR_INVALID_NAMESPACE
- CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
or otherwise incorrect parameters)
CIM_ERR_FAILED (some other unspecified error occurred)
"""
ch = env.get_cimom_handle()
- if ch.is_subclass(object_name.namespace,
+ if ch.is_subclass(object_name.namespace,
sub=object_name.classname,
super='LMI_SoftwareInstallationService') or \
ch.is_subclass(object_name.namespace,
diff --git a/src/software/lmi/software/LMI_SoftwareIdentityChecks.py b/src/software/lmi/software/LMI_SoftwareIdentityChecks.py
index 7c1b60a..3aecfa2 100644
--- a/src/software/lmi/software/LMI_SoftwareIdentityChecks.py
+++ b/src/software/lmi/software/LMI_SoftwareIdentityChecks.py
@@ -126,6 +126,8 @@ class LMI_SoftwareIdentityChecks(CIMProvider2):
CIM_ERR_FAILED (some other unspecified error occurred)
"""
+ # this won't be supported because of enormous amount of data
+ # all installed files of all installed rpms would have to be enumerated
raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED,
"Enumeration of instances is not supported.")
diff --git a/src/software/lmi/software/LMI_SoftwareIdentityFileCheck.py b/src/software/lmi/software/LMI_SoftwareIdentityFileCheck.py
index df5e761..0cad75b 100644
--- a/src/software/lmi/software/LMI_SoftwareIdentityFileCheck.py
+++ b/src/software/lmi/software/LMI_SoftwareIdentityFileCheck.py
@@ -95,6 +95,7 @@ class LMI_SoftwareIdentityFileCheck(CIMProvider2):
"""
# this won't be supported because of enormous amount of data
+ # all installed files of all installed rpms would have to be enumerated
raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED)
@cmpi_logging.trace_method
diff --git a/src/software/lmi/software/cimom_entry.py b/src/software/lmi/software/cimom_entry.py
index 3a788a1..9c90d46 100644
--- a/src/software/lmi/software/cimom_entry.py
+++ b/src/software/lmi/software/cimom_entry.py
@@ -132,12 +132,12 @@ def authorize_filter(env, fltr, class_name, op, owner):
It asks us to verify whether this filter is allowed.
- :param fltr: (``String``) Contains the filter that must be authorized.
+ :param fltr: (``String``) Contains the filter that must be authorized.
:param class_name: (``String``) Contains the class name extracted
- from the filter FROM clause.
+ from the filter FROM clause.
:param op: The name of the class for which monitoring is required.
Only the namespace part is set if className is a process indication.
- :param owner The owner argument is the destination owner.
+ :param owner The owner argument is the destination owner.
"""
IndicationManager.get_instance().authorize_filter(
env, fltr, class_name, op, owner)
@@ -145,19 +145,19 @@ def authorize_filter(env, fltr, class_name, op, owner):
def activate_filter(env, fltr, class_name, class_path, first_activation):
"""
CIMOM callback.
-
+
It ask us to begin monitoring a resource. The function shall begin
monitoring the resource according to the filter express only.
:param fltr: (``String``) The filter argument contains the filter
- specification for this subscription to become active.
+ specification for this subscription to become active.
:param class_name: (``String``) The class name extracted from the filter
- FROM clause.
+ FROM clause.
:param class_path: (``CIMInstanceName``) The name of the class for which
monitoring is required. Only the namespace part is set if eventType
- is a process indication.
+ is a process indication.
:param first_activation: (``bool``) Set to true if this is the first
- filter for className.
+ filter for className.
"""
IndicationManager.get_instance().activate_filter(
env, fltr, class_name, class_path, first_activation)
@@ -169,14 +169,14 @@ def deactivate_filter(env, fltr, class_name, class_path, last_activation):
Informs us that monitoring using this filter should stop.
:param fltr: (``String``) The filter argument contains the filter
- specification for this subscription to become active.
+ specification for this subscription to become active.
:param class_name: (``String``) The class name extracted from the filter
- FROM clause.
+ FROM clause.
:param class_path: (``CIMInstanceName``) class_path The name of the class
for which monitoring is required. Only the namespace part is set
- if className is a process indication.
+ if className is a process indication.
:last_activation: (``bool``) Set to true if this is the last filter for
- className.
+ className.
"""
IndicationManager.get_instance().deactivate_filter(
env, fltr, class_name, class_path, last_activation)
diff --git a/src/software/lmi/software/core/IdentityFileCheck.py b/src/software/lmi/software/core/IdentityFileCheck.py
index 283f9ef..c525481 100644
--- a/src/software/lmi/software/core/IdentityFileCheck.py
+++ b/src/software/lmi/software/core/IdentityFileCheck.py
@@ -438,7 +438,7 @@ class FileCheck(object):
Most of properties return tuple:
``(installed, original)``
- where
+ where
``installed`` is a state of property of installed file, while
``original`` is the value stored in RPM database.
@@ -763,7 +763,7 @@ def object_path2file_check(objpath):
version_match = util.RE_EVRA.match(objpath['Version'])
if not version_match:
raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_PARAMETER,
- 'Failed to parse \"Version\" property for valid EVRA: "%s".' %
+ 'Failed to parse \"Version\" property for valid EVRA: "%s".' %
objpath['Version'])
pkg_fltr = util.nevra2filter(objpath["SoftwareElementID"])
if any( pkg_fltr[attr] != version_match.group(attr)
@@ -899,12 +899,12 @@ def _fill_non_key_values(model, file_check):
for mattr, fattr, kwargs, convert in (
('LastModificationTime', 'last_modification_time',
{'type':'uint64'}, pywbem.Uint64),
- ('FileType' , 'file_type' ,{'type':'uint16'}, pywbem.Uint16),
- ('UserID' , 'user_id' ,{'type':'uint32'}, pywbem.Uint32),
- ('GroupID' , 'group_id' ,{'type':'uint32'}, pywbem.Uint32),
- ('FileMode' , 'file_mode' ,{'type':'uint32'}, pywbem.Uint32),
- ('FileSize' , 'file_size' ,{'type':'uint64'}, pywbem.Uint64),
- ('LinkTarget' , 'link_target' ,{'type':'string'}, str),
+ ('FileType' , 'file_type' ,{'type':'uint16'}, pywbem.Uint16),
+ ('UserID' , 'user_id' ,{'type':'uint32'}, pywbem.Uint32),
+ ('GroupID' , 'group_id' ,{'type':'uint32'}, pywbem.Uint32),
+ ('FileMode' , 'file_mode' ,{'type':'uint32'}, pywbem.Uint32),
+ ('FileSize' , 'file_size' ,{'type':'uint64'}, pywbem.Uint64),
+ ('LinkTarget' , 'link_target' ,{'type':'string'}, str),
('FileChecksum', 'file_checksum',{'type':'string'}, str)):
installed, orig = getattr(file_check, fattr)
kwargs['value'] = None if orig is None else convert(orig)
diff --git a/src/software/lmi/software/core/InstallationServiceCapabilities.py b/src/software/lmi/software/core/InstallationServiceCapabilities.py
index 2a78d16..0f6cb58 100644
--- a/src/software/lmi/software/core/InstallationServiceCapabilities.py
+++ b/src/software/lmi/software/core/InstallationServiceCapabilities.py
@@ -197,7 +197,7 @@ def get_instance(model=None):
model = pywbem.CIMInstance(
"LMI_SoftwareInstallationServiceCapabilities", path=path)
model['InstanceID'] = path['InstanceID']
-
+
model['CanAddToCollection'] = True
model['Caption'] = 'Capabilities of LMI:LMI_SoftwareInstallationService'
model['Description'] = ('This instance provides information'
diff --git a/src/software/lmi/software/yumdb/jobs.py b/src/software/lmi/software/yumdb/jobs.py
index 098dfbf..dbd9d5e 100644
--- a/src/software/lmi/software/yumdb/jobs.py
+++ b/src/software/lmi/software/yumdb/jobs.py
@@ -552,7 +552,7 @@ class YumCheckPackage(YumSpecificPackageJob): #pylint: disable=R0903
class YumCheckPackageFile(YumCheckPackage): #pylint: disable=R0903
"""
- Request verification information for particular file of installed
+ Request verification information for particular file of installed
package.
Worker replies with ``(pkg_info, pkg_check)``.
diff --git a/src/software/lmi/software/yumdb/process.py b/src/software/lmi/software/yumdb/process.py
index 3b1c0d9..1a9e1c0 100644
--- a/src/software/lmi/software/yumdb/process.py
+++ b/src/software/lmi/software/yumdb/process.py
@@ -888,7 +888,7 @@ class YumWorker(Process):
# *************************************************************************
def run(self):
"""
- Thread's entry point. After initial setup it calls _main_loop().
+ Process's entry point. After initial setup it calls _main_loop().
"""
setup_logging()
global LOG
diff --git a/src/software/test/test_software_identity_file_check.py b/src/software/test/test_software_identity_file_check.py
index 027e17f..49cd97d 100755
--- a/src/software/test/test_software_identity_file_check.py
+++ b/src/software/test/test_software_identity_file_check.py
@@ -238,7 +238,7 @@ class TestSoftwareIdentityFileCheck(
pywbem.Uint16(3), #Checksum
pywbem.Uint16(9), #LastModificationTime
]), set(inst["FailedFlags"]))
-
+
self.assertGreater(inst["FileSize"], inst["FileSizeOriginal"],
"File size should be greater, then expected for regular file"
" %s:%s"%(pkg.name, filepath))