Explorar o código

Run yum clean all in RH based morphers

Alessandro Pilotti %!s(int64=8) %!d(string=hai) anos
pai
achega
9ef406812a
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      coriolis/osmorphing/redhat.py

+ 10 - 0
coriolis/osmorphing/redhat.py

@@ -127,6 +127,16 @@ class BaseRedHatMorphingTools(base.BaseLinuxOSMorphingTools):
             yum_cmd = 'yum remove %s -y' % package_name
             self._exec_cmd_chroot(yum_cmd)
 
+    def _yum_clean_all(self):
+        self._exec_cmd_chroot("yum clean all")
+        if self._test_path('/var/cache/yum'):
+            self._exec_cmd_chroot("rm -rf /var/cache/yum")
+
+    def pre_packages_install(self, package_names):
+        super(BaseRedHatMorphingTools, self).pre_packages_install(
+            package_names)
+        self._yum_clean_all()
+
     def install_packages(self, package_names):
         self._yum_install(package_names, self._enable_repos)