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
This commit is contained in:
Andreas Scheuring 2015-02-26 09:08:09 +01:00 committed by Ian Wienand
parent da533fa790
commit 15d40a5683

View File

@ -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/\", "