diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2021-02-05 15:27:52 -0800 |
---|---|---|
committer | dheerajd-msys <dheeraj.dubey@msystechnologies.com> | 2021-03-04 15:53:10 +0530 |
commit | 572642291db33e455ebe451a0e2743e9fadb6e91 (patch) | |
tree | cc75db4648c0c485c4244b8abd16963f3bd50ea4 | |
parent | 52e5accd057374f76dcca5d0cc8e51a98d1a3162 (diff) | |
download | chef-572642291db33e455ebe451a0e2743e9fadb6e91.tar.gz |
DNF package: fix abrt errors
For people with ABRT logging every exit of chef-client would have ABRT
errors due to readline returning '' for EOF and then the JSON parsing
throwing.
This causes it to exit gracefully.
AFAIK there was actually no impact to this bug and chef was behaving
entirely correctly in terms of doing its job, but the python helper was
shutting down uncleanly.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | lib/chef/provider/package/dnf/dnf_helper.py | 4 | ||||
-rw-r--r-- | lib/chef/provider/package/yum/yum_helper.py | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/chef/provider/package/dnf/dnf_helper.py b/lib/chef/provider/package/dnf/dnf_helper.py index 325ce14041..302bcd9562 100644 --- a/lib/chef/provider/package/dnf/dnf_helper.py +++ b/lib/chef/provider/package/dnf/dnf_helper.py @@ -168,6 +168,10 @@ try: setup_exit_handler() line = inpipe.readline() + # only way to detect EOF in python + if line == "": + break + try: command = json.loads(line) except ValueError: diff --git a/lib/chef/provider/package/yum/yum_helper.py b/lib/chef/provider/package/yum/yum_helper.py index 47cbe2efe6..465dceab18 100644 --- a/lib/chef/provider/package/yum/yum_helper.py +++ b/lib/chef/provider/package/yum/yum_helper.py @@ -196,6 +196,10 @@ try: setup_exit_handler() line = inpipe.readline() + # only way to detect EOF in python + if line == "": + break + try: command = json.loads(line) except ValueError, e: |