From 15d40a56832baadc65fe5261f5f53ce24ad00e84 Mon Sep 17 00:00:00 2001 From: Andreas Scheuring Date: Thu, 26 Feb 2015 09:08:09 +0100 Subject: [PATCH] Add quotation marks to parse string correclty on rhel7 Problem: On rhel7 the lvm.conf filter is generated wrongly Root Cause: bash-4.2 (rhel7/centos7) incorrectly splits herestrings when combined with IFS. See [1] and [2] Quoting the argument is a safe work-around [1] http://stackoverflow.com/questions/20144593/trying-to-split-a-string-into-two-variables [2] https://bugzilla.redhat.com/show_bug.cgi?id=1196566 Closes-Bug #1425839 Change-Id: Ie82fcd7ef0deacbb6aaf18c5c466a5d5baf52681 --- lib/cinder_backends/lvm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cinder_backends/lvm b/lib/cinder_backends/lvm index d83c31a81e..52fc6fbf63 100644 --- a/lib/cinder_backends/lvm +++ b/lib/cinder_backends/lvm @@ -78,9 +78,9 @@ function configure_cinder_backend_conf_lvm { for pv_info in $(sudo pvs --noheadings -o name,vg_name --separator ';'); do echo_summary "Evaluate PV info for Cinder lvm.conf: $pv_info" - IFS=';' read pv vg <<< $pv_info + IFS=';' read pv vg <<< "$pv_info" for line in ${conf_entries}; do - IFS='=' read label group <<< $line + IFS='=' read label group <<< "$line" group=$(echo $group|sed "s/^ *//g") if [[ "$vg" == "$group" ]]; then new="\"a$pv/\", "