Browse code

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

Huan Xie authored on 2017/01/16 13:07:04
Showing 1 changed files
... ...
@@ -317,7 +317,7 @@ function install_conntrack_tools {
317 317
         # Only support conntrack-tools in Dom0 with XS7.0 and above
318 318
         if [ ! -f /usr/sbin/conntrackd ]; then
319 319
             sed -i s/#baseurl=/baseurl=/g /etc/yum.repos.d/CentOS-Base.repo
320
-            centos_ver=$(yum version nogroups |grep Installed | cut -d' ' -f 2 | cut -d'.' -f1-2 | tr '-' '.')
320
+            centos_ver=$(yum version nogroups |grep Installed | cut -d' ' -f 2 | cut -d'/' -f 1 | cut -d'-' -f 1)
321 321
             yum install -y --enablerepo=base --releasever=$centos_ver conntrack-tools
322 322
             # Backup conntrackd.conf after install conntrack-tools, use the one with statistic mode
323 323
             mv /etc/conntrackd/conntrackd.conf /etc/conntrackd/conntrackd.conf.back