summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2021-02-05 15:27:52 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2021-02-05 15:30:23 -0800
commitdccabff4042ca8d556f6f56f6ae87da6265150bf (patch)
tree4ea85b8202c57b8d77c0970988ef8a985b09c9b3
parentb247aaf6b189d681604beb6a1b1c554a9b651695 (diff)
downloadchef-lcg/fix-abrt-errors.tar.gz
DNF package: fix abrt errorslcg/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.py4
-rw-r--r--lib/chef/provider/package/yum/yum_helper.py4
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: