Change the way to get conntrack-tools version
In the incoming XenServer, it failed to install conntrack-tools
in Dom0 due to the bash script which is trying to find the correct
CentOS release version to be used in yum command. This patch is to
fix the problem
Change-Id: If7f169e118ccb7c29fc479c361417a916dc40b40
diff --git a/tools/xen/functions b/tools/xen/functions
index e1864eb..93f3413 100644
--- a/tools/xen/functions
+++ b/tools/xen/functions
@@ -317,7 +317,7 @@
# Only support conntrack-tools in Dom0 with XS7.0 and above
if [ ! -f /usr/sbin/conntrackd ]; then
sed -i s/#baseurl=/baseurl=/g /etc/yum.repos.d/CentOS-Base.repo
- centos_ver=$(yum version nogroups |grep Installed | cut -d' ' -f 2 | cut -d'.' -f1-2 | tr '-' '.')
+ centos_ver=$(yum version nogroups |grep Installed | cut -d' ' -f 2 | cut -d'/' -f 1 | cut -d'-' -f 1)
yum install -y --enablerepo=base --releasever=$centos_ver conntrack-tools
# Backup conntrackd.conf after install conntrack-tools, use the one with statistic mode
mv /etc/conntrackd/conntrackd.conf /etc/conntrackd/conntrackd.conf.back