[Kimchi-devel] [PATCH] bug fix: check all Red Hat distributions for yum package management

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Thu Feb 27 08:43:09 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

There are several Red Hat distributions.
use startswith("red hat") to check this is a Red Hat distributions.

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 src/kimchi/repositories.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/kimchi/repositories.py b/src/kimchi/repositories.py
index 0ab0b1a..f0c6762 100644
--- a/src/kimchi/repositories.py
+++ b/src/kimchi/repositories.py
@@ -27,9 +27,7 @@ from kimchi.basemodel import Singleton
 from kimchi.exception import InvalidOperation, InvalidParameter
 from kimchi.exception import OperationFailed, NotFoundError, MissingParameter
 
-YUM_DISTROS = ['fedora', 'red hat enterprise linux',
-               'red hat enterprise linux server', 'opensuse ',
-               'suse linux enterprise server ']
+YUM_DISTROS = ['fedora', 'opensuse ', 'suse linux enterprise server ']
 APT_DISTROS = ['debian', 'ubuntu']
 
 
@@ -52,7 +50,7 @@ class Repositories(object):
         self._repo_storage = {}
 
         self._distro = platform.linux_distribution()[0].lower()
-        if (self._distro in YUM_DISTROS):
+        if (self._distro in YUM_DISTROS or self._distro.startswith('red hat')):
             self._pkg_mnger = YumRepo()
         elif (self._distro in APT_DISTROS):
             self._pkg_mnger = AptRepo()
-- 
1.8.4.2




More information about the Kimchi-devel mailing list