[PATCH 3/3] yum-cron: independent enable/disable

Zdenek Pavlas zpavlas at redhat.com
Mon Jan 13 15:45:55 UTC 2014


yum-cron attempts to update metadata on each run, even with
update_messages = download_updates = apply_updates = False.

This adds a master 'enabled' option, eg for people that want
to run yum-cron only daily, but not hourly.
---
 yum-cron/yum-cron.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
index 386a7a0..92bb508 100755
--- a/yum-cron/yum-cron.py
+++ b/yum-cron/yum-cron.py
@@ -255,6 +255,7 @@ class YumCronConfig(BaseConfig):
     """Class to parse configuration information from the config file, and
     to store this information.
     """
+    enabled = BoolOption(True)
     system_name = Option(gethostname())
     output_width = IntOption(80)
     random_sleep = IntOption(0)
@@ -691,8 +692,9 @@ def main():
     else:
         base = YumCronBase()
 
-    #Run the update check
-    base.updatesCheck()
+    if base.opts.enabled:
+        # Update metadata, optionally run the update check
+        base.updatesCheck()
 
 if __name__ == "__main__":
     main()
-- 
1.7.11.7



More information about the Yum-devel mailing list