Browse code

Fixed conditions to determine if current distribution is a Fedora based distribution

stack.sh line 223:
if [[ is_fedora && $DISTRO == "rhel6" ]]; then

stack.sh line 234:
if [[ is_fedora && ( $DISTRO == "rhel6" || $DISTRO == "rhel7" ) ]]; then

stack.sh line 358:
if [[ is_fedora && $DISTRO == "rhel6" ]]; then

Condition [[ is_fedora && $DISTRO == "rhel6" ]] return wrong result.
This condition is equivalent to the
[[ -n is_fedora && $DISTRO == "rhel6" ]]. First expression -n is_fedora
always not null, therefore this condition the same is
[[ $DISTRO = "rhel6" ]].

Change-Id: Ida9eaa7950554bcd2f183dede7ad19522f9ca558
Closes-Bug: #1393684

Oleg Gashev authored on 2014/11/18 16:16:01
Showing 1 changed files
... ...
@@ -220,7 +220,7 @@ fi
220 220
 # Some distros need to add repos beyond the defaults provided by the vendor
221 221
 # to pick up required packages.
222 222
 
223
-if [[ is_fedora && $DISTRO == "rhel6" ]]; then
223
+if is_fedora && [ $DISTRO == "rhel6" ]; then
224 224
     # Installing Open vSwitch on RHEL requires enabling the RDO repo.
225 225
     RHEL6_RDO_REPO_RPM=${RHEL6_RDO_REPO_RPM:-"http://rdo.fedorapeople.org/openstack-icehouse/rdo-release-icehouse.rpm"}
226 226
     RHEL6_RDO_REPO_ID=${RHEL6_RDO_REPO_ID:-"openstack-icehouse"}
... ...
@@ -231,7 +231,7 @@ if [[ is_fedora && $DISTRO == "rhel6" ]]; then
231 231
     fi
232 232
 fi
233 233
 
234
-if [[ is_fedora && ( $DISTRO == "rhel6" || $DISTRO == "rhel7" ) ]]; then
234
+if is_fedora && [[ $DISTRO == "rhel6" || $DISTRO == "rhel7" ]]; then
235 235
     # RHEL requires EPEL for many Open Stack dependencies
236 236
 
237 237
     # note we always remove and install latest -- some environments
... ...
@@ -355,7 +355,7 @@ function echo_nolog {
355 355
     echo $@ >&3
356 356
 }
357 357
 
358
-if [[ is_fedora && $DISTRO == "rhel6" ]]; then
358
+if is_fedora && [ $DISTRO == "rhel6" ]; then
359 359
     # poor old python2.6 doesn't have argparse by default, which
360 360
     # outfilter.py uses
361 361
     is_package_installed python-argparse || install_package python-argparse