Alon Bar-Lev has uploaded a new change for review.

Change subject: packagers: yum: optionally do not expire yum cache
......................................................................

packagers: yum: optionally do not expire yum cache

Change-Id: Ic86ef0b2d560fecb3d2e68abe60c0fb5e459c56e
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M ChangeLog
M README.environment
M src/otopi/constants.py
M src/plugins/otopi/packagers/yumpackager.py
4 files changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/otopi refs/changes/04/18104/1

diff --git a/ChangeLog b/ChangeLog
index aed7c5a..41eb661 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
  * packagers: yum: selinux: do not change type to rpm_t.
  * packagers: yum: rollback complex transaction successfully.
  * packagers: yum: workaround non-standard encoding of yum.i18n.
+ * packagers: yum: optionally do not expire yum cache.
  * java: do not fail to set null environment.
  * dialog: fix handling of empty string notes.
  * dialog: support tuples for note like list.
diff --git a/README.environment b/README.environment
index aaf512b..5bfca8e 100644
--- a/README.environment
+++ b/README.environment
@@ -110,5 +110,8 @@
 PACKAGER/yumpackagerEnabled(bool) [True]
     Enable yum packager.
 
+PACKAGER/yumExpireCache(bool) [True]
+    Expire yum cache at startup.
+
 PACKAGER/keepAliveInterval(int) [30]
     Keep alive interval for status in seconds.
diff --git a/src/otopi/constants.py b/src/otopi/constants.py
index 343c687..7bc90ad 100644
--- a/src/otopi/constants.py
+++ b/src/otopi/constants.py
@@ -161,6 +161,7 @@
 @util.codegen
 class PackEnv(object):
     YUMPACKAGER_ENABLED = 'PACKAGER/yumpackagerEnabled'
+    YUMPACKAGER_EXPIRE_CACHE = 'PACKAGER/yumExpireCache'
     KEEP_ALIVE_INTERVAL = 'PACKAGER/keepAliveInterval'
     YUM_DISABLED_PLUGINS = 'PACKAGER/yumDisabledPlugins'
     YUM_ENABLED_PLUGINS = 'PACKAGER/yumEnabledPlugins'
diff --git a/src/plugins/otopi/packagers/yumpackager.py 
b/src/plugins/otopi/packagers/yumpackager.py
index 292f55a..91c925f 100644
--- a/src/plugins/otopi/packagers/yumpackager.py
+++ b/src/plugins/otopi/packagers/yumpackager.py
@@ -167,6 +167,10 @@
                 constants.PackEnv.KEEP_ALIVE_INTERVAL,
                 constants.Defaults.PACKAGER_KEEP_ALIVE_INTERVAL
             )
+            self.environment.setdefault(
+                constants.PackEnv.YUMPACKAGER_EXPIRE_CACHE,
+                True
+            )
 
             self._refreshMiniyum()
 
@@ -200,8 +204,9 @@
         condition=lambda self: self._enabled,
     )
     def _setup(self):
-        with self._miniyum.transaction():
-            self._miniyum.clean(['expire-cache'])
+        if self.environment[constants.PackEnv.YUMPACKAGER_EXPIRE_CACHE]:
+            with self._miniyum.transaction():
+                self._miniyum.clean(['expire-cache'])
         self.environment[constants.CoreEnv.MAIN_TRANSACTION].append(
             self.YumTransaction(
                 parent=self,


-- 
To view, visit http://gerrit.ovirt.org/18104
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic86ef0b2d560fecb3d2e68abe60c0fb5e459c56e
Gerrit-PatchSet: 1
Gerrit-Project: otopi
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to