clean-ups in the file

- replace tabs with 4 spaces
- removed trailing spaces
- fixed indenting
- made if; then look the same


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2f858a7d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2f858a7d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2f858a7d

Branch: refs/heads/master
Commit: 2f858a7d088f4a41c35bf1c0577f922a51fc3ca2
Parents: ee9b644
Author: Remi Bergsma <[email protected]>
Authored: Tue Aug 11 14:55:16 2015 +0200
Committer: Remi Bergsma <[email protected]>
Committed: Tue Aug 11 14:55:16 2015 +0200

----------------------------------------------------------------------
 .../storage/secondary/cloud-install-sys-tmplt   | 69 +++++++++++---------
 1 file changed, 37 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2f858a7d/scripts/storage/secondary/cloud-install-sys-tmplt
----------------------------------------------------------------------
diff --git a/scripts/storage/secondary/cloud-install-sys-tmplt 
b/scripts/storage/secondary/cloud-install-sys-tmplt
index 89f386a..91b3a7c 100755
--- a/scripts/storage/secondary/cloud-install-sys-tmplt
+++ b/scripts/storage/secondary/cloud-install-sys-tmplt
@@ -8,9 +8,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 #   http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -45,40 +45,41 @@ jasypt='/usr/share/cloudstack-common/lib/jasypt-1.9.2.jar'
 while getopts 'm:h:f:u:Ft:e:s:o:r:d:p:'# OPTION
 do
   case $OPTION in
-  m)   mflag=1
-               mntpoint="$OPTARG"
-               ;;
-  f)   fflag=1
-               tmpltimg="$OPTARG"
-               ;;
-  u)   uflag=1
-               url="$OPTARG"
-               ;;
-  F)   Fflag=1 ;;
+  m)    mflag=1
+        mntpoint="$OPTARG"
+        ;;
+  f)    fflag=1
+        tmpltimg="$OPTARG"
+        ;;
+  u)    uflag=1
+        url="$OPTARG"
+        ;;
+  F)    Fflag=1
+        ;;
   t)    templateId="$OPTARG"
-               ;;
+        ;;
   e)    ext="$OPTARG"
-               ;;
+        ;;
   h)    hyper="$OPTARG"
-               ;;
+        ;;
   s)    sflag=1
-               msKey="$OPTARG"
-                ;;
+        msKey="$OPTARG"
+        ;;
   o)    oflag=1
         dbHost="$OPTARG"
-                ;;
+        ;;
   r)    rflag=1
         dbUser="$OPTARG"
-                ;;
+        ;;
   d)    dflag=1
         dbPassword="$OPTARG"
-                ;;
+        ;;
   p)    pflag=1
         dbPort="$OPTARG"
-                ;;
-  ?)   usage
-               failed 2
-               ;;
+        ;;
+  ?)    usage
+        failed 2
+        ;;
   esac
 done
 
@@ -94,28 +95,32 @@ then
   failed 2
 fi
 
-if [ ! -d $mntpoint ] 
+if [ ! -d $mntpoint ]
 then
   echo "mount point $mntpoint doesn't exist\n"
   failed 4
 fi
 
-if [[ "$fflag" == "1" && ! -f $tmpltimg ]] 
+if [[ "$fflag" == "1" && ! -f $tmpltimg ]]
 then
   echo "template image file $tmpltimg doesn't exist"
   failed 3
 fi
 
-if [ -f /etc/cloudstack/management/db.properties ]; then
-    if [ "$pflag" != 1 ]; then
+if [ -f /etc/cloudstack/management/db.properties ]
+then
+    if [ "$pflag" != 1 ]
+    then
         dbPort=$(sed '/^\#/d' /etc/cloudstack/management/db.properties | grep 
'db.cloud.port'  | tail -n 1 | cut -d "=" -f2- | sed 
's/^[[:space:]]*//;s/[[:space:]]*$//')
     fi
 
-    if [ "$oflag" != 1 ]; then
+    if [ "$oflag" != 1 ]
+    then
         dbHost=$(sed '/^\#/d' /etc/cloudstack/management/db.properties | grep 
'db.cloud.host'  | tail -n 1 | cut -d "=" -f2- | sed 
's/^[[:space:]]*//;s/[[:space:]]*$//')
     fi
 
-    if [ "$rflag" != 1 ]; then
+    if [ "$rflag" != 1 ]
+    then
         dbUser=$(sed '/^\#/d' /etc/cloudstack/management/db.properties | grep 
'db.cloud.username'  | tail -n 1 | cut -d "=" -f2- | sed 
's/^[[:space:]]*//;s/[[:space:]]*$//')
     fi
 
@@ -186,8 +191,8 @@ fi
 
 if [ ! $templateId ]
 then
-       echo "Unable to get template Id from database"
-       failed 8
+    echo "Unable to get template Id from database"
+    failed 8
 fi
 
 _uuid=$(uuidgen)

Reply via email to