summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2018-04-14 16:14:36 +0100
committerGitHub <noreply@github.com>2018-04-14 16:14:36 +0100
commit3770466481559b92f9200a92590a02cffaa6c594 (patch)
tree8e083c3401829a3b771f58c476520f44c1d51149 /lib/chef
parentc408c44fe5a6eba8b3c74f7333acb0c55a43ebd9 (diff)
parentd8dda18ce6558e688d2c37d379d53ba0e5b3b690 (diff)
downloadchef-3770466481559b92f9200a92590a02cffaa6c594.tar.gz
Merge pull request #7155 from tomdoherty/master
Catch json.load exceptions causing syslog errors
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/provider/package/yum/yum_helper.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/chef/provider/package/yum/yum_helper.py b/lib/chef/provider/package/yum/yum_helper.py
index 090b101316..3bb70e75fb 100644
--- a/lib/chef/provider/package/yum/yum_helper.py
+++ b/lib/chef/provider/package/yum/yum_helper.py
@@ -186,7 +186,13 @@ while 1:
sys.exit(0)
setup_exit_handler()
line = inpipe.readline()
- command = json.loads(line)
+
+ try:
+ command = json.loads(line)
+ except ValueError, e:
+ base.closeRpmDB()
+ sys.exit(0)
+
if command['action'] == "whatinstalled":
query(command)
elif command['action'] == "whatavailable":