diff options
author | Jan Safranek <jsafrane@redhat.com> | 2013-04-12 10:44:10 +0200 |
---|---|---|
committer | Jan Safranek <jsafrane@redhat.com> | 2013-04-16 09:39:33 +0200 |
commit | f128220b0d690f06d04816e8d217619a0c978091 (patch) | |
tree | 9f65e1fd6940538444703e3b6f829b415c7a332f | |
parent | b04d75b0200b2af845f993e3d5d861b0f91118c0 (diff) | |
download | openlmi-providers-f128220b0d690f06d04816e8d217619a0c978091.tar.gz openlmi-providers-f128220b0d690f06d04816e8d217619a0c978091.tar.xz openlmi-providers-f128220b0d690f06d04816e8d217619a0c978091.zip |
Updated the filter queries to match those in software provider.
Both Storage and Software providers should use the same CQL filters for
all job-realted indications.
-rw-r--r-- | src/python/openlmi/common/JobManager.py | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/python/openlmi/common/JobManager.py b/src/python/openlmi/common/JobManager.py index 122fc7c..b4b7bb1 100644 --- a/src/python/openlmi/common/JobManager.py +++ b/src/python/openlmi/common/JobManager.py @@ -629,11 +629,11 @@ class JobManager(object): timeout. """ - IND_JOB_PERCENT_UPDATED = "JobPercentUpdated" - IND_JOB_SUCCEEDED = "JobSucceeded" - IND_JOB_FAILED = "JobFailed" - IND_JOB_CHANGED = "JobChanged" - IND_JOB_CREATED = "JobCreated" + IND_JOB_PERCENT_UPDATED = "PercentUpdated" + IND_JOB_SUCCEEDED = "Succeeded" + IND_JOB_FAILED = "Failed" + IND_JOB_CHANGED = "Changed" + IND_JOB_CREATED = "Created" @cmpi_logging.trace_method def __init__(self, name, namespace, indication_manager): @@ -686,7 +686,7 @@ class JobManager(object): filters = { self.IND_JOB_PERCENT_UPDATED: { "Query" : "SELECT * FROM CIM_InstModification WHERE " - "SourceInstance ISA CIM_ConcreteJob AND " + "SourceInstance ISA %(classname)s AND " "SourceInstance.CIM_ConcreteJob::PercentComplete <> " "PreviousInstance.CIM_ConcreteJob::PercentComplete", "Description" : "Modification of Percentage Complete for a " @@ -694,36 +694,35 @@ class JobManager(object): }, self.IND_JOB_SUCCEEDED: { "Query" : "SELECT * FROM CIM_InstModification WHERE " - "SourceInstance ISA CIM_ConcreteJob AND ANY " - "SourceInstance.CIM_ConcreteJob::OperationalStatus[*] = 17 " - "AND ANY " - "SourceInstance.CIM_ConcreteJob::OperationalStatus[*] = 2", - "Description": "Modification of Operational Status for a " - "Concrete Job to 'Complete' and 'OK'.", + "SourceInstance ISA %(classname)s AND " + "SourceInstance.CIM_ConcreteJob::JobState = 17", + "Description": "Modification of Job State for a " + "Concrete Job to 'Complete'.", }, self.IND_JOB_FAILED: { "Query" : "SELECT * FROM CIM_InstModification WHERE " - "SourceInstance ISA CIM_ConcreteJob AND ANY " - "SourceInstance.CIM_ConcreteJob::OperationalStatus[*] = 17 " - "AND ANY " - "SourceInstance.CIM_ConcreteJob::OperationalStatus[*] = 6", - "Description": "Modification of Operational Status for a " - "Concrete Job to 'Complete' and 'Error'.", + "SourceInstance ISA %(classname)s AND " + "SourceInstance.CIM_ConcreteJob::JobState = 10", + "Description": "Modification of Job State for a " + "Concrete Job to 'Exception'.", }, self.IND_JOB_CHANGED: { "Query" : "SELECT * FROM CIM_InstModification WHERE " - "SourceInstance ISA CIM_ConcreteJob AND " + "SourceInstance ISA %(classname)s AND " "SourceInstance.CIM_ConcreteJob::JobState <> " "PreviousInstance.CIM_ConcreteJob::JobState", "Description": "Modification of Job State for a ConcreteJob.", }, self.IND_JOB_CREATED: { "Query" : "SELECT * FROM CIM_InstCreation WHERE " - "SourceInstance ISA CIM_ConcreteJob", + "SourceInstance ISA %(classname)s", "Description": "Creation of a ConcreteJob.", }, } - self.indication_manager.add_filters(filters) + # add class name + for f in filters.itervalues(): + f['Query'] = f['Query'] % {"classname" : self.job_classname } + self.indication_manager.add_filters(self.job_classname, filters) @cmpi_logging.trace_method def get_providers(self): |