diff options
author | Tom Doherty <tom.doherty@fixnetix.com> | 2018-04-13 20:59:35 +0100 |
---|---|---|
committer | Tom Doherty <tom.doherty@fixnetix.com> | 2018-04-13 21:46:19 +0100 |
commit | d8dda18ce6558e688d2c37d379d53ba0e5b3b690 (patch) | |
tree | 914b9aac85acaa02f1ab5fcb9c717345035bb4b8 /lib | |
parent | 89af0c684e2c64a9ae2e21d5687660f1baa53d89 (diff) | |
download | chef-d8dda18ce6558e688d2c37d379d53ba0e5b3b690.tar.gz |
Catch json.load exceptions causing syslog errors
Signed-off-by: Tom Doherty <tom.doherty@fixnetix.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/package/yum/yum_helper.py | 8 |
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": |