Skip to content

Commit 3ce420c

Browse files
Carles FiguerolaCarles Figuerola
authored andcommitted
CLOUDSTACK-9029: Proper support to identify CentOS 7 version number
1 parent f65dec4 commit 3ce420c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

python/lib/cloud_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
version = file("/etc/redhat-release").readline()
6969
if version.find("Red Hat Enterprise Linux Server release 6") != -1:
7070
distro = RHEL6
71-
elif version.find("CentOS release") != -1:
71+
elif version.find("CentOS") != -1:
7272
distro = CentOS
7373
else:
7474
distro = CentOS

python/lib/cloudutils/utilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def __init__(self):
114114
self.distro = "RHEL6"
115115
elif version.find("Red Hat Enterprise Linux Server release 7") != -1:
116116
self.distro = "RHEL7"
117-
elif version.find("CentOS release") != -1:
117+
elif version.find("CentOS") != -1:
118118
self.distro = "CentOS"
119119
else:
120120
self.distro = "RHEL5"

scripts/vm/hypervisor/versions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ CODENAME=""
3232
if [ -f /etc/redhat-release ] ; then
3333
DIST=`cat /etc/redhat-release | awk '{print $1}'`
3434
CODENAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
35-
REV=`cat /etc/redhat-release | awk '{print $3}'`
35+
REV=`cat /etc/redhat-release | awk '{print $3,$4}' | grep -o "[0-9.]*"`
3636
elif [ -f /etc/lsb-release ] ; then
3737
DIST=`cat /etc/lsb-release | grep DISTRIB_ID | tr "\n" ' '| sed s/.*=//`
3838
REV=`cat /etc/lsb-release | grep DISTRIB_RELEASE | tr "\n" ' '| sed s/.*=//`

0 commit comments

Comments
 (0)