summaryrefslogtreecommitdiffstats
path: root/src/software
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2013-11-28 11:29:21 +0100
committerMichal Minar <miminar@redhat.com>2013-11-29 09:26:56 +0100
commit39850b89e7d34053c50410dc2c8ba021dd0fe94f (patch)
tree589cf57149db71069b6dc1e469bbc275540c92f0 /src/software
parent85b821bbabf16b4f96a636ae19817941445c37b0 (diff)
downloadopenlmi-providers-39850b89e7d34053c50410dc2c8ba021dd0fe94f.tar.gz
openlmi-providers-39850b89e7d34053c50410dc2c8ba021dd0fe94f.tar.xz
openlmi-providers-39850b89e7d34053c50410dc2c8ba021dd0fe94f.zip
software: fixed service associators generator
LMI_SoftwareInstallationServiceAffectsElement association class generated just the newest available packages. With this patch, all available packages are generated. When generating associators of installation service ComputerSystem instance was omitted. This patch adds it to generated items. Resolves: rhbz#1034698
Diffstat (limited to 'src/software')
-rw-r--r--src/software/lmi/software/LMI_SoftwareInstallationServiceAffectsElement.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/software/lmi/software/LMI_SoftwareInstallationServiceAffectsElement.py b/src/software/lmi/software/LMI_SoftwareInstallationServiceAffectsElement.py
index b0294f2..32ff1c7 100644
--- a/src/software/lmi/software/LMI_SoftwareInstallationServiceAffectsElement.py
+++ b/src/software/lmi/software/LMI_SoftwareInstallationServiceAffectsElement.py
@@ -45,7 +45,8 @@ def generate_service_referents(env, model, object_name, keys_only):
yield model
avail_model = util.new_instance_name("LMI_SoftwareIdentity")
- for pkg_info in YumDB.get_instance().get_package_list('available'):
+ for pkg_info in YumDB.get_instance().get_package_list('available',
+ allow_duplicates=True, sort=True):
InstallationServiceAffectsElement.fill_model_identity(model, pkg_info,
keys_only=keys_only,
identity_model=avail_model)
@@ -141,7 +142,8 @@ class LMI_SoftwareInstallationServiceAffectsElement(CIMProvider2):
yield model
avail_model = util.new_instance_name("LMI_SoftwareIdentity")
- for pkg_info in YumDB.get_instance().get_package_list('available'):
+ for pkg_info in YumDB.get_instance().get_package_list('available',
+ allow_duplicates=True, sort=True):
InstallationServiceAffectsElement.fill_model_identity(model,
pkg_info, keys_only=keys_only, identity_model=avail_model)
yield model
@@ -232,6 +234,12 @@ class LMI_SoftwareInstallationServiceAffectsElement(CIMProvider2):
raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_PARAMETER,
e.args[1])
+ # ComputerSystem
+ ch = env.get_cimom_handle()
+ model = ch.GetInstance(ComputerSystem.get_path(env))
+ yield model
+
+ # SoftwareIdentity
model = pywbem.CIMInstance(classname='LMI_SoftwareIdentity')
model.path = util.new_instance_name('LMI_SoftwareIdentity')
with YumDB.get_instance() as ydb: