Reviewed-by: Shu Ming <shuming(a)linux.vnet.ibm.com>
2014/2/27 16:43, shaohef(a)linux.vnet.ibm.com:
From: ShaoHe Feng <shaohef(a)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(a)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()