From 0177568c93c1773ba22989ea1565dd666c516de3 Mon Sep 17 00:00:00 2001 From: Miguel Angel Ajo Date: Tue, 1 Aug 2017 09:02:09 +0000 Subject: [PATCH] devstack: fix ovs install on fedora like OS This patch I3d0981fbe30f2436f00c200919b50aeb97491252 resolved custom kernel version, but introduced a bug for the 3.x series. This patch avoids the replacement in the case of the 3.x series. Closes-Bug: #1704077 Co-Authored-By: Moshe Levi Change-Id: Iff1c5a39fe4b0d9320910d0cfafdd36873825d03 --- devstack/lib/ovs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/devstack/lib/ovs b/devstack/lib/ovs index 9490f4001cd..7c3e7a7f14d 100644 --- a/devstack/lib/ovs +++ b/devstack/lib/ovs @@ -53,10 +53,15 @@ function prepare_for_compilation { if is_fedora ; then # is_fedora covers Fedora, RHEL, CentOS, etc... - # dash is illegal character in rpm version so replace - # them with underscore like it is done in the kernel - # https://github.com/torvalds/linux/blob/master/scripts/package/mkspec#L25 - KERNEL_VERSION=`echo $KERNEL_VERSION | sed -e "s/-/_/g"` + if [[ ${KERNEL_VERSION:0:2} != "3." ]]; then + # dash is illegal character in rpm version so replace + # them with underscore like it is done in the kernel + # https://github.com/torvalds/linux/blob/master/scripts/package/mkspec#L25 + # but only for latest series of the kernel, not 3.x + + KERNEL_VERSION=`echo $KERNEL_VERSION | tr - _` + fi + echo NOTE: if kernel-devel-$KERNEL_VERSION or kernel-headers-$KERNEL_VERSION installation echo failed, please, provide a repository with the package, or yum update / reboot echo your machine to get the latest kernel.