Fix judging condition flaw 47/29647/3
authorJulien-zte <zhang.jun3g@zte.com.cn>
Thu, 2 Mar 2017 13:11:17 +0000 (21:11 +0800)
committerJulien <zhang.jun3g@zte.com.cn>
Tue, 7 Mar 2017 02:03:18 +0000 (10:03 +0800)
*the judging condition var is $volumes_to_remove instead of
$containers_to_kill at line 95 in kolla-build.sh

*unify the code indent

Change-Id: Ia6722d32f98fbee938e4eb6f1be0cedd3dc38aa8
Signed-off-by: Julien <zhang.jun3g@zte.com.cn>
Signed-off-by: zhongjun <zhong.jun@zte.com.cn>
ci/kolla-build.sh

index 53ad8c1..6b7d330 100755 (executable)
@@ -92,7 +92,7 @@ function cleanup_registry_server {
         echo "Removing containers... $containers_to_kill"
         (sudo docker rm -v -f ${containers_to_kill} 2>&1) > /dev/null
 
-        if [[ ! -z "$containers_to_kill" ]]; then
+        if [[ ! -z "$volumes_to_remove" ]]; then
             echo "Removing volumes... $volumes_to_remove"
             (sudo docker volume rm ${volumes_to_remove} 2>&1) || true > /dev/null
         fi
@@ -145,7 +145,7 @@ function pack_registry_data {
 function update_kolla_code {
     echo "Updating Kolla code"
     if [ ! -d $KOLLA_GIT_DIR ] ; then
-            mkdir -p $KOLLA_GIT_DIR
+        mkdir -p $KOLLA_GIT_DIR
     fi
 
     if [ ! -d $KOLLA_GIT_DIR/kolla ] ; then