From 1f26c0ef61e4e37bacac68014d993df108f70296 Mon Sep 17 00:00:00 2001
From: Oleg Gashev <oleg@gashev.net>
Date: Tue, 18 Nov 2014 02:16:01 -0500
Subject: [PATCH] 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
---
 stack.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/stack.sh b/stack.sh
index 7635f32298..940c4e50e9 100755
--- a/stack.sh
+++ b/stack.sh
@@ -220,7 +220,7 @@ fi
 # Some distros need to add repos beyond the defaults provided by the vendor
 # to pick up required packages.
 
-if [[ is_fedora && $DISTRO == "rhel6" ]]; then
+if is_fedora && [ $DISTRO == "rhel6" ]; then
     # Installing Open vSwitch on RHEL requires enabling the RDO repo.
     RHEL6_RDO_REPO_RPM=${RHEL6_RDO_REPO_RPM:-"http://rdo.fedorapeople.org/openstack-icehouse/rdo-release-icehouse.rpm"}
     RHEL6_RDO_REPO_ID=${RHEL6_RDO_REPO_ID:-"openstack-icehouse"}
@@ -231,7 +231,7 @@ if [[ is_fedora && $DISTRO == "rhel6" ]]; then
     fi
 fi
 
-if [[ is_fedora && ( $DISTRO == "rhel6" || $DISTRO == "rhel7" ) ]]; then
+if is_fedora && [[ $DISTRO == "rhel6" || $DISTRO == "rhel7" ]]; then
     # RHEL requires EPEL for many Open Stack dependencies
 
     # note we always remove and install latest -- some environments
@@ -355,7 +355,7 @@ function echo_nolog {
     echo $@ >&3
 }
 
-if [[ is_fedora && $DISTRO == "rhel6" ]]; then
+if is_fedora && [ $DISTRO == "rhel6" ]; then
     # poor old python2.6 doesn't have argparse by default, which
     # outfilter.py uses
     is_package_installed python-argparse || install_package python-argparse