summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mof/60_LMI_Software.mof165
-rw-r--r--src/software/openlmi/software/LMI_AffectedSoftwareJobElement.py2
-rw-r--r--src/software/openlmi/software/core/InstallationService.py21
3 files changed, 102 insertions, 86 deletions
diff --git a/mof/60_LMI_Software.mof b/mof/60_LMI_Software.mof
index 9f2f2ce..12b4f9d 100644
--- a/mof/60_LMI_Software.mof
+++ b/mof/60_LMI_Software.mof
@@ -21,6 +21,9 @@
#pragma locale ("en_US")
//#pragma namespace ("root/cimv2")
+/* ****************************************************************************
+ * Central class of Software Inventory and Update profiles
+ */
class LMI_SoftwareIdentity : CIM_SoftwareIdentity {
[Implemented(true), Override("InstanceID"), Description(
@@ -78,6 +81,9 @@ class LMI_SoftwareIdentity : CIM_SoftwareIdentity {
};
+/******************************************************************************
+ * Software inventory classes
+ */
class LMI_SystemSoftwareCollection : CIM_SystemSpecificCollection {
[Implemented(true), Override("InstanceID")]
@@ -88,39 +94,6 @@ class LMI_SystemSoftwareCollection : CIM_SystemSpecificCollection {
};
-[Association]
-class LMI_HostedSoftwareCollection : CIM_HostedCollection {
-
- [Override("Antecedent")]
- Linux_ComputerSystem REF Antecedent;
-
- [Override("Dependent")]
- LMI_SystemSoftwareCollection REF Dependent;
-
-};
-
-[Association]
-class LMI_MemberOfSoftwareCollection : CIM_MemberOfCollection {
-
- [Override("Collection")]
- LMI_SystemSoftwareCollection REF Collection;
-
- [Override("Member")]
- LMI_SoftwareIdentity REF Member;
-
-};
-
-[Association]
-class LMI_InstalledSoftwareIdentity : CIM_InstalledSoftwareIdentity {
-
- [Override("InstalledSoftware")]
- LMI_SoftwareIdentity REF InstalledSoftware;
-
- [Override("System")]
- Linux_ComputerSystem REF System;
-
-};
-
class LMI_SoftwareIdentityResource : CIM_SoftwareIdentityResource {
[Implemented(true), Override("CreationClassName")]
@@ -272,6 +245,42 @@ class LMI_SoftwareIdentityResource : CIM_SoftwareIdentityResource {
};
+/******************************************************************************
+ * Software inventory associations
+ */
+[Association]
+class LMI_HostedSoftwareCollection : CIM_HostedCollection {
+
+ [Override("Antecedent")]
+ Linux_ComputerSystem REF Antecedent;
+
+ [Override("Dependent")]
+ LMI_SystemSoftwareCollection REF Dependent;
+
+};
+
+[Association]
+class LMI_MemberOfSoftwareCollection : CIM_MemberOfCollection {
+
+ [Override("Collection")]
+ LMI_SystemSoftwareCollection REF Collection;
+
+ [Override("Member")]
+ LMI_SoftwareIdentity REF Member;
+
+};
+
+[Association]
+class LMI_InstalledSoftwareIdentity : CIM_InstalledSoftwareIdentity {
+
+ [Override("InstalledSoftware")]
+ LMI_SoftwareIdentity REF InstalledSoftware;
+
+ [Override("System")]
+ Linux_ComputerSystem REF System;
+
+};
+
[Association]
class LMI_ResourceForSoftwareIdentity : CIM_SAPAvailableForElement {
@@ -294,6 +303,9 @@ class LMI_HostedSoftwareIdentityResource : CIM_HostedAccessPoint {
};
+/******************************************************************************
+ * Software update profile classes
+ */
class LMI_SoftwareInstallationService : CIM_SoftwareInstallationService {
[Implemented(true), Override("CreationClassName")]
@@ -576,47 +588,6 @@ class LMI_SoftwareInstallationServiceCapabilities :
};
-[Association]
-class LMI_AssociatedSoftwareInstallationServiceCapabilities :
- CIM_ElementCapabilities {
-
- [Override("Capabilities")]
- LMI_SoftwareInstallationServiceCapabilities REF Capabilities;
-
- [Override("ManagedElement")]
- LMI_SoftwareInstallationService REF ManagedElement;
-
- [Implemented(true), Override("Characteristics")]
- uint16 Characteristics[];
-
-};
-
-[Association]
-class LMI_HostedSoftwareInstallationService : CIM_HostedService {
-
- [Override("Antecedent")]
- Linux_ComputerSystem REF Antecedent;
-
- [Override("Dependent")]
- LMI_SoftwareInstallationService REF Dependent;
-
-};
-
-[Association]
-class LMI_SoftwareInstallationServiceAffectsElement :
- CIM_ServiceAffectsElement {
-
- [Override("AffectingElement")]
- LMI_SoftwareInstallationService REF AffectingElement;
-
- [Implemented(true), Override("ElementEffects")]
- uint16 ElementEffects[];
-
- [Implemented(true), Override("OtherElementEffectsDescriptions")]
- string OtherElementEffectsDescriptions[];
-
-};
-
class LMI_SoftwareInstallationJob : LMI_ConcreteJob {
[Implemented(true), Override("InstanceID")]
@@ -651,6 +622,9 @@ class LMI_SoftwareInstallationJob : LMI_ConcreteJob {
class LMI_SoftwareMethodResult : LMI_MethodResult {
};
+/******************************************************************************
+ * Software update associations
+ */
[Association]
class LMI_AssociatedSoftwareJobMethodResult : LMI_AssociatedJobMethodResult {
@@ -681,6 +655,49 @@ class LMI_AffectedSoftwareJobElement : LMI_AffectedJobElement {
};
+[Association]
+class LMI_AssociatedSoftwareInstallationServiceCapabilities :
+ CIM_ElementCapabilities {
+
+ [Override("Capabilities")]
+ LMI_SoftwareInstallationServiceCapabilities REF Capabilities;
+
+ [Override("ManagedElement")]
+ LMI_SoftwareInstallationService REF ManagedElement;
+
+ [Implemented(true), Override("Characteristics")]
+ uint16 Characteristics[];
+
+};
+
+[Association]
+class LMI_HostedSoftwareInstallationService : CIM_HostedService {
+
+ [Override("Antecedent")]
+ Linux_ComputerSystem REF Antecedent;
+
+ [Override("Dependent")]
+ LMI_SoftwareInstallationService REF Dependent;
+
+};
+
+[Association]
+class LMI_SoftwareInstallationServiceAffectsElement :
+ CIM_ServiceAffectsElement {
+
+ [Override("AffectingElement")]
+ LMI_SoftwareInstallationService REF AffectingElement;
+
+ [Implemented(true), Override("ElementEffects")]
+ uint16 ElementEffects[];
+
+ [Implemented(true), Override("OtherElementEffectsDescriptions")]
+ string OtherElementEffectsDescriptions[];
+
+};
+
+/******************************************************************************
+ * Software update indications
[Indication]
class LMI_SoftwareInstCreation : CIM_InstCreation {
};
diff --git a/src/software/openlmi/software/LMI_AffectedSoftwareJobElement.py b/src/software/openlmi/software/LMI_AffectedSoftwareJobElement.py
index 601b1c3..33c0522 100644
--- a/src/software/openlmi/software/LMI_AffectedSoftwareJobElement.py
+++ b/src/software/openlmi/software/LMI_AffectedSoftwareJobElement.py
@@ -83,7 +83,7 @@ class LMI_AffectedSoftwareJobElement(CIMProvider2):
elif ch.is_subclass(affected.namespace,
sub=affected.classname, super='Linux_ComputerSystem'):
AffectedSoftwareJobElement.fill_model_computer_system(
- model, env, keys_only=False)
+ model, job, keys_only=False)
elif ch.is_subclass(affected.namespace,
sub=affected.classname, super='LMI_SystemSoftwareCollection'):
diff --git a/src/software/openlmi/software/core/InstallationService.py b/src/software/openlmi/software/core/InstallationService.py
index 40e863e..ccb27a6 100644
--- a/src/software/openlmi/software/core/InstallationService.py
+++ b/src/software/openlmi/software/core/InstallationService.py
@@ -747,34 +747,33 @@ def install_or_remove_package(env, method,
try:
ydb = YumDB.get_instance()
if action == values.InstallOptions.Uninstall:
- nevra = Identity.object_path2nevra(
- source, with_epoch='ALWAYS')
- cmpi_logging.logger.info('removing package %s', nevra)
- jobid = ydb.remove_package(nevra, async=True, **metadata)
+ src = Identity.object_path2nevra(source, with_epoch='ALWAYS')
+ cmpi_logging.logger.info('removing package %s', src)
+ jobid = ydb.remove_package(src, async=True, **metadata)
else:
update = action == values.InstallOptions.Update
- if method == InstallationJob.JOB_METHOD_INSTALL_FROM_URI:
+ if method == Job.JOB_METHOD_INSTALL_FROM_URI:
cmpi_logging.logger.info('%s package "%s"',
'updating' if update else 'installing', source)
+ src = source
jobid = ydb.install_package_from_uri(
source, update_only=update, force=force or repair,
async=True, **metadata)
else: # software identity
- nevra = Identity.object_path2nevra(source, with_epoch='ALWAYS')
+ src = Identity.object_path2nevra(source, with_epoch='ALWAYS')
if update:
- jobid = ydb.update_package(nevra,
+ jobid = ydb.update_package(src,
force=force or repair, async=True, **metadata)
else:
- jobid = ydb.install_package(nevra,
+ jobid = ydb.install_package(src,
force=force or repair, async=True, **metadata)
cmpi_logging.logger.info('installation job %s for pkg "%s"'
- ' enqueued', jobid, nevra)
+ ' enqueued', jobid, src)
return jobid
except (pywbem.CIMError, errors.InvalidURI) as exc:
cmpi_logging.logger.exception('failed to install/remove package "%s"'
' from %s: %s', source,
- JOB_METHOD_SRC_PARAM_NAMES[method].lower(),
- str(exc))
+ JOB_METHOD_SRC_PARAM_NAMES[method].lower(), str(exc))
raise InstallationError(values.Unspecified_Error, str(exc))