summaryrefslogtreecommitdiffstats
path: root/src/software/lmi/software/yumdb/process.py
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2013-11-08 16:11:18 +0100
committerMichal Minar <miminar@redhat.com>2013-11-08 16:46:22 +0100
commit4dbb389e772f48aafd4c56b404a1833ea22ab509 (patch)
tree607ecad3fe7e53bb11e426bf75ecfd77dec8b151 /src/software/lmi/software/yumdb/process.py
parent2de64ba34ef7dda1763898441407c6f96a944fec (diff)
downloadopenlmi-providers-4dbb389e772f48aafd4c56b404a1833ea22ab509.tar.gz
openlmi-providers-4dbb389e772f48aafd4c56b404a1833ea22ab509.tar.xz
openlmi-providers-4dbb389e772f48aafd4c56b404a1833ea22ab509.zip
software: do a proper clean up when terminating
Separated process did a clean up only when the session ended. But when cimom is suddenly terminated or killed, process can receive terminating command even during the session. Let's clean up yum database and cached objects when that happens.
Diffstat (limited to 'src/software/lmi/software/yumdb/process.py')
-rw-r--r--src/software/lmi/software/yumdb/process.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/software/lmi/software/yumdb/process.py b/src/software/lmi/software/yumdb/process.py
index d38d198..367e934 100644
--- a/src/software/lmi/software/yumdb/process.py
+++ b/src/software/lmi/software/yumdb/process.py
@@ -518,6 +518,9 @@ class YumWorker(Process):
LOG.exception("job %s failed", job)
self._jobmgr.finish_job(job, result, data)
if job is None:
+ self._session_level = 0
+ self._session_ended = False
+ self._unlock_database()
LOG.info("waiting for %s to finish", self._jobmgr.name)
self._jobmgr.join()
break