From ba3c8f48bb07707e421f1c5aac5acedd1e63d3fd Mon Sep 17 00:00:00 2001 From: Huan Xie Date: Sun, 15 Jan 2017 20:07:04 -0800 Subject: [PATCH] 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 --- tools/xen/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/xen/functions b/tools/xen/functions index e1864eb4bb..93f3413d6d 100644 --- a/tools/xen/functions +++ b/tools/xen/functions @@ -317,7 +317,7 @@ function install_conntrack_tools { # 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