[PATCH] yum-cron: only_report_errors option to turn off update summaries. BZ 1018068

Zdenek Pavlas zpavlas at redhat.com
Fri Oct 11 07:51:49 UTC 2013


---
 etc/yum-cron.conf    | 6 +++++-
 yum-cron/yum-cron.py | 6 ++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/etc/yum-cron.conf b/etc/yum-cron.conf
index aa7cbfc..ee2db57 100644
--- a/etc/yum-cron.conf
+++ b/etc/yum-cron.conf
@@ -8,7 +8,7 @@
 # minimal-security-severity:Critical =  --sec-severity=Critical upgrade-minimal
 update_cmd = default
 
-# Whether a message should emitted when updates are available.
+# Whether yum-cron should check for updates.
 update_messages = yes
 
 # Whether updates should be downloaded when they are available. Note
@@ -20,6 +20,10 @@ download_updates = yes
 # the update to be applied
 apply_updates = no
 
+# When updates were applied with no errors, should yum-cron send
+# a notification with the transaction summary?
+only_report_errors = no
+
 # Maximum amout of time to randomly sleep, in minutes.  The program
 # will sleep for a random amount of time between 0 and random_sleep
 # minutes before running.  This is useful for e.g. staggering the
diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
index 9f985f9..debe33a 100755
--- a/yum-cron/yum-cron.py
+++ b/yum-cron/yum-cron.py
@@ -705,6 +705,7 @@ class YumCronConfig(BaseConfig):
     update_messages = BoolOption(False)
     update_cmd = Option("default")
     apply_updates = BoolOption(False)
+    only_report_errors = BoolOption(False)
     download_updates = BoolOption(False)
     yum_config_file = Option("/etc/yum.conf")
     group_list = ListOption([])
@@ -998,7 +999,8 @@ class YumCronBase(yum.YumBase):
             self.emitUpdateFailed([str(err)])
             sys.exit(1)
 
-        self.emitInstalled()
+        if emit :
+            self.emitInstalled()
         self.emitMessages()
 
     def updatesCheck(self):
@@ -1048,7 +1050,7 @@ class YumCronBase(yum.YumBase):
             self.releaseLocks()
             sys.exit(0)
 
-        self.installUpdates(True)
+        self.installUpdates(not self.opts.only_report_errors)
 
         self.releaseLocks()
         sys.exit(0)
-- 
1.7.11.7



More information about the Yum-devel mailing list