diff options
-rw-r--r-- | src/software/openlmi/software/LMI_SoftwareInstallationService.py | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/software/openlmi/software/LMI_SoftwareInstallationService.py b/src/software/openlmi/software/LMI_SoftwareInstallationService.py index 2b8c6a6..eec3869 100644 --- a/src/software/openlmi/software/LMI_SoftwareInstallationService.py +++ b/src/software/openlmi/software/LMI_SoftwareInstallationService.py @@ -785,3 +785,78 @@ class LMI_SoftwareInstallationService(CIMProvider2): out_params = [pywbem.CIMParameter('Job', type='reference', value=None)] return ( self.values.InstallFromByteStream.Not_Supported , out_params) + + @cmpi_logging.trace_method + def cim_method_verifyinstalledidentity(self, env, object_name, + param_source=None, + param_target=None): + """Implements LMI_SoftwareInstallationService. \ + VerifyInstalledIdentity() + + Start a job to verify installed package represented by + SoftwareIdentity (source) (Source) on a ManagedElement (Target). + If 0 is returned, the function completed successfully and no + ConcreteJob instance was required. If 4096/0x1000 is returned, a + ConcreteJob will be started to perform the verification. The Job's + reference will be returned in the output parameter Job. In former + case, the Failed parameterwill contain all associated file checks, + that did not pass. In the latter case this property will be NULL. + + Keyword arguments: + env -- Provider Environment (pycimmb.ProviderEnvironment) + object_name -- A pywbem.CIMInstanceName or pywbem.CIMCLassName + specifying the object on which the method VerifyInstalledIdentity() + should be invoked. + param_source -- The input parameter Source ( + type REF (pywbem.CIMInstanceName( + classname='LMI_SoftwareIdentity', ...)) + Reference to the installed SoftwareIdentity to be verified. + + param_target -- The input parameter Target ( + type REF (pywbem.CIMInstanceName( + classname='CIM_ManagedElement', ...)) + Reference to the ManagedElement that the Software Identity is + installed on. + + + Returns a two-tuple containing the return value ( + type pywbem.Uint32 self.Values.VerifyInstalledIdentity) + and a list of CIMParameter objects representing the output parameters + + Output parameters: + Job -- (type REF (pywbem.CIMInstanceName( + classname='LMI_SoftwareVerificationJob', ...)) + Reference to the job (may be null if job completed). + + Failed -- (type REF (pywbem.CIMInstanceName( + classname='LMI_SoftwareIdentityFileCheck', ...)) + Array of file checks that did not pass verification. This is + NULL in case that asynchronous job has been started. + + + Possible Errors: + CIM_ERR_ACCESS_DENIED + CIM_ERR_INVALID_PARAMETER (including missing, duplicate, + unrecognized or otherwise incorrect parameters) + CIM_ERR_NOT_FOUND (the target CIM Class or instance does not + exist in the specified namespace) + CIM_ERR_METHOD_NOT_AVAILABLE (the CIM Server is unable to honor + the invocation request) + CIM_ERR_FAILED (some other unspecified error occurred) + """ + InstallationService.check_path(env, object_name, "object_name") + out_params = [pywbem.CIMParameter('Job', type='reference', value=None)] + try: + jobid = InstallationService.verify_package( + env, Job.JOB_METHOD_VERIFY_INSTALLED_IDENTITY, + param_source, param_target) + rval = self.values.VerifyInstalledIdentity. \ + Method_Parameters_Checked___Job_Started + out_params[0].value = Job.job2model(jobid, + class_name="LMI_SoftwareVerificationJob") + except InstallationService.InstallationError as exc: + cmpi_logging.logger.error( + "failed to launch verification job: %s", exc.description) + rval = exc.return_code + return (rval, out_params) + |