Use more advanced regular expressions in quickstart.sh

Now for backward compatibility the script converts some node
configuration file names.
For example, a name that contains "ha.yml" is implicitely converted
to "pacemaker.yml": non_ha.yml, ha.yml_bak, alpha.yml, etc.
This approach creates problems and inconveniences.
To avoid it, srictly speaking, we should check the full match of the
file name and ignore all other cases.

Change-Id: I3cd3b6fc5eacdba7d6db164ae7596cce02620ac0
Closes-bug: #1674411
This commit is contained in:
Mike Fedosin 2017-12-21 17:33:42 +01:00
parent 88bb69bd3e
commit f3ace2dd71
1 changed files with 7 additions and 7 deletions

View File

@ -396,31 +396,31 @@ fi
# allow the deprecated config files to work
OLD_CONFIG=""
if [[ "$OPT_CONFIG" =~ .*ha.yml ]]; then
if [[ "$OPT_CONFIG" =~ (^|.*/)ha.yml$ ]]; then
OLD_CONFIG=$OPT_CONFIG
OPT_CONFIG=$OPT_WORKDIR/config/general_config/pacemaker.yml;
OPT_NODES=$OPT_WORKDIR/config/nodes/3ctlr_1comp.yml;
elif [[ "$OPT_CONFIG" =~ .*ceph.yml ]]; then
elif [[ "$OPT_CONFIG" =~ (^|.*/)ceph.yml$ ]]; then
OLD_CONFIG=$OPT_CONFIG
OPT_CONFIG=$OPT_WORKDIR/config/general_config/minimal.yml;
OPT_NODES=$OPT_WORKDIR/config/nodes/1ctlr_1comp_1ceph.yml;
elif [[ "$OPT_CONFIG" =~ .*ha_big.yml ]]; then
elif [[ "$OPT_CONFIG" =~ (^|.*/)ha_big.yml$ ]]; then
OLD_CONFIG=$OPT_CONFIG
OPT_CONFIG=$OPT_WORKDIR/config/general_config/pacemaker.yml;
OPT_NODES=$OPT_WORKDIR/config/nodes/3ctlr_3comp.yml;
elif [[ "$OPT_CONFIG" =~ .*fake_ha_ipa.yml ]]; then
elif [[ "$OPT_CONFIG" =~ (^|.*/)fake_ha_ipa.yml$ ]]; then
OLD_CONFIG=$OPT_CONFIG
OPT_CONFIG=$OPT_WORKDIR/config/general_config/ipa.yml;
OPT_NODES=$OPT_WORKDIR/config/nodes/1ctlr_1comp_1supp.yml;
elif [[ "$OPT_CONFIG" =~ .*ha_ipa.yml ]]; then
elif [[ "$OPT_CONFIG" =~ (^|.*/)ha_ipa.yml$ ]]; then
OLD_CONFIG=$OPT_CONFIG
OPT_CONFIG=$OPT_WORKDIR/config/general_config/ipa.yml;
OPT_NODES=$OPT_WORKDIR/config/nodes/3ctlr_1comp.yml;
elif [[ "$OPT_CONFIG" =~ .*ha_ipv6.yml ]]; then
elif [[ "$OPT_CONFIG" =~ (^|.*/)ha_ipv6.yml$ ]]; then
OLD_CONFIG=$OPT_CONFIG
OPT_CONFIG=$OPT_WORKDIR/config/general_config/ipv6.yml;
OPT_NODES=$OPT_WORKDIR/config/nodes/3ctlr_1comp.yml;
elif [[ "$OPT_CONFIG" =~ .*minimal_pacemaker.yml ]]; then
elif [[ "$OPT_CONFIG" =~ (^|.*/)minimal_pacemaker.yml$ ]]; then
OLD_CONFIG=$OPT_CONFIG
OPT_CONFIG=$OPT_WORKDIR/config/general_config/pacemaker.yml;
fi