summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeng Pan <fpan@redhat.com>2016-09-23 12:14:44 -0400
committerFeng Pan <fpan@redhat.com>2016-09-26 18:55:50 +0000
commita151bf4b58bb83753f5d4de7f34a6f77c61d87ed (patch)
tree1cb876e6c478b8de099a2bd4191dc49225150a3d
parent4282687699d38e4be4b39f8397f78768899ac17c (diff)
Fix PREFIX calculation for attach_interface_to_ovs
Make sure we only get number portion of PREFIX in ifcfg file, this avoids getting potentially the double quotes around the prefix. JIRA: APEX-163 Change-Id: Ia59a437927a75d9bb99efd324ccb5e4a5201c051 Signed-off-by: Feng Pan <fpan@redhat.com> (cherry picked from commit dd6bb69f77dda4d89876efd1524e907a1bf44748)
-rw-r--r--lib/common-functions.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/common-functions.sh b/lib/common-functions.sh
index 6941093c..4dd8a131 100644
--- a/lib/common-functions.sh
+++ b/lib/common-functions.sh
@@ -72,7 +72,7 @@ function attach_interface_to_ovs {
if [ -z "$if_mask" ]; then
# we can look for PREFIX here, then convert it to NETMASK
- if_prefix=$(sed -n 's/^PREFIX=\(.*\)$/\1/p' ${if_file})
+ if_prefix=$(sed -n 's/^PREFIX=[^0-9]*\([0-9][0-9]*\)[^0-9]*$/\1/p' ${if_file})
if_mask=$(prefix2mask ${if_prefix})
fi