summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-06-25 11:59:45 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-06-25 11:59:45 -0700
commit0d71053a8ee7678c42ac04661dd31ef9c693b6ff (patch)
tree89feddc4a1fb0035b1609f2590de03d2907777e9
parentb2e2e154c1c7e112e3cbcb9999bea766ac41d7fc (diff)
downloadchef-0d71053a8ee7678c42ac04661dd31ef9c693b6ff.tar.gz
be a bit more careful in the exit handler as well
mostly cosmetic Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/provider/package/yum/yum_helper.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/provider/package/yum/yum_helper.py b/lib/chef/provider/package/yum/yum_helper.py
index 1b9f9c0f67..47cbe2efe6 100644
--- a/lib/chef/provider/package/yum/yum_helper.py
+++ b/lib/chef/provider/package/yum/yum_helper.py
@@ -169,7 +169,8 @@ def query(command):
# to keep process tables clean. additional error handling should probably be added to the retry loop
# on the ruby side.
def exit_handler(signal, frame):
- base.closeRpmDB()
+ if base is not None:
+ base.closeRpmDB()
sys.exit(0)
def setup_exit_handler():