Blame SOURCES/stderr_not_fatal_1360765.patch

c5477d
From fb9c485418e59cfead3ab28d8ff8cfb7a19bba48 Mon Sep 17 00:00:00 2001
c5477d
From: Vratislav Podzimek <vpodzime@redhat.com>
c5477d
Date: Tue, 23 Aug 2016 22:19:18 +0200
c5477d
Subject: [PATCH 3/3] Don't require blank stderr when running the oscap tool
c5477d
c5477d
It may report some warnings and complete successfully. It should be safe for us
c5477d
to rely on the exit code.
c5477d
c5477d
Resolves: rhbz#1355756
c5477d
Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com>
c5477d
---
c5477d
 org_fedora_oscap/common.py | 4 ++--
c5477d
 1 file changed, 2 insertions(+), 2 deletions(-)
c5477d
c5477d
diff --git a/org_fedora_oscap/common.py b/org_fedora_oscap/common.py
c5477d
index 6f95b2d..1b3eaa5 100644
c5477d
--- a/org_fedora_oscap/common.py
c5477d
+++ b/org_fedora_oscap/common.py
c5477d
@@ -147,7 +147,7 @@ def _run_oscap_gen_fix(profile, fpath, template, ds_id="", xccdf_id="",
c5477d
 
c5477d
     # pylint thinks Popen has no attribute returncode
c5477d
     # pylint: disable-msg=E1101
c5477d
-    if proc.returncode != 0 or stderr:
c5477d
+    if proc.returncode != 0:
c5477d
         msg = "Failed to generate fix rules with the oscap tool: %s" % stderr
c5477d
         raise OSCAPaddonError(msg)
c5477d
 
c5477d
@@ -224,7 +224,7 @@ def run_oscap_remediate(profile, fpath, ds_id="", xccdf_id="", tailoring="",
c5477d
     # save stdout?
c5477d
     # pylint thinks Popen has no attribute returncode
c5477d
     # pylint: disable-msg=E1101
c5477d
-    if proc.returncode not in (0, 2) or stderr:
c5477d
+    if proc.returncode not in (0, 2):
c5477d
         # 0 -- success; 2 -- no error, but checks/remediation failed
c5477d
         msg = "Content evaluation and remediation with the oscap tool "\
c5477d
             "failed: %s" % stderr
c5477d
-- 
c5477d
2.7.4
c5477d