summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2013-05-10 16:00:40 +0200
committerMichal Minar <miminar@redhat.com>2013-05-10 16:17:46 +0200
commit607b37a81d8c9ecb1d2b478659e0ef433c4c97ae (patch)
tree6459391cb6f813cd90f44282d2786ede7b11465c
parenta3b52bc68e479218103a582193ad7a4ab15822b7 (diff)
downloadopenlmi-providers-607b37a81d8c9ecb1d2b478659e0ef433c4c97ae.tar.gz
openlmi-providers-607b37a81d8c9ecb1d2b478659e0ef433c4c97ae.tar.xz
openlmi-providers-607b37a81d8c9ecb1d2b478659e0ef433c4c97ae.zip
fixed method invocation of SoftwareInstallationService
Undefined variable used in logging statement would generate error for installation from URI.
-rw-r--r--src/software/openlmi/software/core/InstallationService.py21
1 files changed, 10 insertions, 11 deletions
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))