diff options
Diffstat (limited to 'src/software/openlmi/software/cimom_entry.py')
-rw-r--r-- | src/software/openlmi/software/cimom_entry.py | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/software/openlmi/software/cimom_entry.py b/src/software/openlmi/software/cimom_entry.py index 6c37c9a..eaa7b0c 100644 --- a/src/software/openlmi/software/cimom_entry.py +++ b/src/software/openlmi/software/cimom_entry.py @@ -21,10 +21,13 @@ # """ -Entry module for OpenLMI Software proviers. +Entry module for OpenLMI Software providers. """ +from multiprocessing import Queue from openlmi.common import cmpi_logging +from openlmi.common.IndicationManager import IndicationManager +from openlmi.software.core import InstallationJob from openlmi.software.LMI_SoftwareIdentity import LMI_SoftwareIdentity from openlmi.software.LMI_SystemSoftwareCollection import \ LMI_SystemSoftwareCollection @@ -61,7 +64,7 @@ from openlmi.software.LMI_AssociatedSoftwareJobMethodResult import \ LMI_AssociatedSoftwareJobMethodResult from openlmi.software.LMI_OwningSoftwareJobElement import \ LMI_OwningSoftwareJobElement -from openlmi.software.yumdb import YumDB +from openlmi.software.yumdb import jobmanager, YumDB def get_providers(env): """ @@ -69,6 +72,11 @@ def get_providers(env): """ cmpi_logging.LogManager(env) + # jobmanager does not understand CIM models, give it a way to transform + # job to CIMIndication instance + jobmanager.JOB_TO_MODEL = lambda job: \ + InstallationJob.job2model(job, keys_only=False) + providers = { "LMI_SoftwareIdentity" : LMI_SoftwareIdentity(env), "LMI_SystemSoftwareCollection" : LMI_SystemSoftwareCollection(env), @@ -91,6 +99,8 @@ def get_providers(env): "LMI_SoftwareInstallationServiceAffectsElement" : \ LMI_SoftwareInstallationServiceAffectsElement(env), "LMI_SoftwareInstallationJob" : LMI_SoftwareInstallationJob(env), + "LMI_SoftwareInstCreation" : LMI_SoftwareInstallationJob(env), + "LMI_SoftwareInstModification" : LMI_SoftwareInstallationJob(env), "LMI_SoftwareMethodResult" : LMI_SoftwareMethodResult(env), "LMI_AffectedSoftwareJobElement" : LMI_AffectedSoftwareJobElement(env), "LMI_AssociatedSoftwareJobMethodResult" : \ @@ -98,8 +108,32 @@ def get_providers(env): "LMI_OwningSoftwareJobElement" : LMI_OwningSoftwareJobElement(env) } + # Initialization of indication manager -- running in separate thread as + # daemon. That means it does not have to be cleaned up. + im = IndicationManager.get_instance( + env, "Software", "root/cimv2", queue=Queue()) + jobmanager.register_filters(im) + return providers +def authorize_filter(env, fltr, ns, classes, owner): + IndicationManager.get_instance().authorize_filter( + env, fltr, ns, classes, owner) + +def activate_filter (env, fltr, ns, classes, first_activation): + IndicationManager.get_instance().activate_filter( + env, fltr, ns, classes, first_activation) + +def deactivate_filter(env, fltr, ns, classes, last_activation): + IndicationManager.get_instance().deactivate_filter( + env, fltr, ns, classes, last_activation) + +def enable_indications(env): + IndicationManager.get_instance().enable_indications(env) + +def disable_indications(env): + IndicationManager.get_instance().disable_indications(env) + def can_unload(_env): """ Says, whether providers can be unloaded. |