diff options
author | Michal Minar <miminar@redhat.com> | 2013-03-20 12:59:49 +0100 |
---|---|---|
committer | Michal Minar <miminar@redhat.com> | 2013-03-20 12:59:49 +0100 |
commit | eed3cc9b4b2a78e238ece6dab185e7c76ab13142 (patch) | |
tree | 8df1d6b3a3a60e42a27882e3d8003de8cddfa92c /src/software/openlmi/software/LMI_InstalledSoftwareIdentity.py | |
parent | 19ab3372fe708be3e937df5d1ed6945ac813b51c (diff) | |
download | openlmi-providers-eed3cc9b4b2a78e238ece6dab185e7c76ab13142.tar.gz openlmi-providers-eed3cc9b4b2a78e238ece6dab185e7c76ab13142.tar.xz openlmi-providers-eed3cc9b4b2a78e238ece6dab185e7c76ab13142.zip |
added new providers, allowed for asynchronous jobs
new providers:
LMI_SoftwareInstallationJob
LMI_SoftwareInstallationService
Diffstat (limited to 'src/software/openlmi/software/LMI_InstalledSoftwareIdentity.py')
-rw-r--r-- | src/software/openlmi/software/LMI_InstalledSoftwareIdentity.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/software/openlmi/software/LMI_InstalledSoftwareIdentity.py b/src/software/openlmi/software/LMI_InstalledSoftwareIdentity.py index b4c1b6f..b349afd 100644 --- a/src/software/openlmi/software/LMI_InstalledSoftwareIdentity.py +++ b/src/software/openlmi/software/LMI_InstalledSoftwareIdentity.py @@ -31,7 +31,7 @@ from pywbem.cim_provider2 import CIMProvider2 from openlmi.common import cmpi_logging from openlmi.software.core import generate_references from openlmi.software.core import ComputerSystem -from openlmi.software.core import SoftwareIdentity +from openlmi.software.core import Identity from openlmi.software.yumdb import YumDB @cmpi_logging.trace_function @@ -48,7 +48,7 @@ def generate_system_referents(env, object_name, model, _keys_only): model["System"] = ComputerSystem.get_path() with YumDB.get_instance() as ydb: for pkg_info in ydb.get_package_list('installed', sort=True): - model["InstalledSoftware"] = SoftwareIdentity.pkg2model( + model["InstalledSoftware"] = Identity.pkg2model( pkg_info, model=pkg_model) yield model @@ -57,8 +57,8 @@ def generate_package_referents(_env, object_name, model, _keys_only): """ Handler for referents enumeration request. """ - pkg_info = SoftwareIdentity.object_path2pkg(object_name, kind="installed") - model['InstalledSoftware'] = SoftwareIdentity.pkg2model(pkg_info) + pkg_info = Identity.object_path2pkg(object_name, kind="installed") + model['InstalledSoftware'] = Identity.pkg2model(pkg_info) model["System"] = ComputerSystem.get_path() yield model @@ -108,9 +108,9 @@ class LMI_InstalledSoftwareIdentity(CIMProvider2): model["System"] = model.path["System"] = ComputerSystem.get_path() with YumDB.get_instance(): - pkg_info = SoftwareIdentity.object_path2pkg( + pkg_info = Identity.object_path2pkg( model['InstalledSoftware'], kind='installed') - model['InstalledSoftware'] = SoftwareIdentity.pkg2model(pkg_info) + model['InstalledSoftware'] = Identity.pkg2model(pkg_info) return model @cmpi_logging.trace_method @@ -147,7 +147,7 @@ class LMI_InstalledSoftwareIdentity(CIMProvider2): with YumDB.get_instance() as yb: pl = yb.get_package_list('installed', sort=True) for pkg in pl: - model['InstalledSoftware'] = SoftwareIdentity.pkg2model( + model['InstalledSoftware'] = Identity.pkg2model( pkg, model=inst_model) yield model @@ -191,7 +191,7 @@ class LMI_InstalledSoftwareIdentity(CIMProvider2): ComputerSystem.check_path_property(env, instance, 'System') with YumDB.get_instance() as ydb: - pkg_info = SoftwareIdentity.object_path2pkg( + pkg_info = Identity.object_path2pkg( instance["InstalledSoftware"], kind="all") if pkg_info.installed: raise pywbem.CIMError(pywbem.CIM_ERR_ALREADY_EXISTS, @@ -199,7 +199,7 @@ class LMI_InstalledSoftwareIdentity(CIMProvider2): cmpi_logging.logger.info('installing package "%s"' % pkg_info) installed = ydb.install_package(pkg_info) cmpi_logging.logger.info('package "%s" installed' % pkg_info) - instance["InstalledSoftware"] = SoftwareIdentity.pkg2model(installed) + instance["InstalledSoftware"] = Identity.pkg2model(installed) return instance @cmpi_logging.trace_method @@ -232,7 +232,7 @@ class LMI_InstalledSoftwareIdentity(CIMProvider2): ComputerSystem.check_path_property(env, instance_name, 'System') with YumDB.get_instance() as ydb: - pkg_info = SoftwareIdentity.object_path2pkg( + pkg_info = Identity.object_path2pkg( instance_name["InstalledSoftware"], kind="installed") cmpi_logging.logger.info('removing package "%s"' % pkg_info) ydb.remove_package(pkg_info) |