From 5c4efd4cff0459ea65914ce07d7307589206b0cd Mon Sep 17 00:00:00 2001 From: Radovan Sroka Date: Mon, 22 Jul 2019 17:21:59 +0200 Subject: [PATCH] Removed stdout output for dnf plugin DNF stdout shouldn't be affected by its plugin. --- dnf/fapolicyd-dnf-plugin.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/dnf/fapolicyd-dnf-plugin.py b/dnf/fapolicyd-dnf-plugin.py index 2c9d65e..3de6651 100644 --- a/dnf/fapolicyd-dnf-plugin.py +++ b/dnf/fapolicyd-dnf-plugin.py @@ -3,6 +3,7 @@ import dnf import os import stat +import sys class Fapolicyd(dnf.Plugin): @@ -11,30 +12,25 @@ class Fapolicyd(dnf.Plugin): file = None def __init__(self, base, cli): - print("fapolicyd-plugin is installed and active") pass def transaction(self): - print("fapolicy-plugin: sending signal to fapolicy daemon") if not os.path.exists(self.pipe): - print("Pipe does not exist (" + self.pipe + ")") - print("Perhaps fapolicy-plugin does not have enough permission") - print("or fapolicyd is not running...") + sys.stderr.write("Pipe does not exist (" + self.pipe + ")\n") + sys.stderr.write("Perhaps fapolicy-plugin does not have enough permissions\n") + sys.stderr.write("or fapolicyd is not running...\n") return if not stat.S_ISFIFO(os.stat(self.pipe).st_mode): - print(self.pipe + ": is not a pipe!") + sys.stderr.write(self.pipe + ": is not a pipe!\n") return try: self.file = open(self.pipe, "w") except PermissionError: - print("fapolicy-plugin does not have write permission: " + self.pipe) + sys.stderr.write("fapolicy-plugin does not have write permission: " + self.pipe + "\n") return self.file.write("1") self.file.close() - - print("Fapolicyd was notified") -