pre-commit: add hook to trim trailing whitespace (#8205)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 73775ae..51ad34f 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -58,7 +58,9 @@
       - id: forbid-submodules
       - id: mixed-line-ending
         exclude: \.(cs|xml)$
-      # - id: trailing-whitespace
+      - id: trailing-whitespace
+        files: \.(in|java|md|py|rb|sh|vue|yaml|yml)$
+        args: [--markdown-linebreak-ext=md]
   - repo: https://github.com/pycqa/flake8
     rev: 7.0.0
     hooks:
diff --git a/CHANGES.md b/CHANGES.md
index ef498f8..9544fc0 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -430,11 +430,11 @@
 [CLOUDSTACK-6099](https://issues.apache.org/jira/browse/CLOUDSTACK-6099) | live migration is failing for vm deployed using dynamic compute offerings with NPE
 [CLOUDSTACK-7528](https://issues.apache.org/jira/browse/CLOUDSTACK-7528) | More verbose logging when sending alert fails
 [CLOUDSTACK-6624](https://issues.apache.org/jira/browse/CLOUDSTACK-6624) | set specifyIpRanges to true if specifyVlan is set to true
-[CLOUDSTACK-7404](https://issues.apache.org/jira/browse/CLOUDSTACK-7404) | Failed to start an instance when originating template has been deleted 
+[CLOUDSTACK-7404](https://issues.apache.org/jira/browse/CLOUDSTACK-7404) | Failed to start an instance when originating template has been deleted
 [CLOUDSTACK-6531](https://issues.apache.org/jira/browse/CLOUDSTACK-6531) | Stopping the router in case of command failures
 [CLOUDSTACK-6115](https://issues.apache.org/jira/browse/CLOUDSTACK-6115) | TravisCI configuration
 [CLOUDSTACK-7405](https://issues.apache.org/jira/browse/CLOUDSTACK-7405) | allowing VR meta-data to be accessed without trailing slash
-[CLOUDSTACK-7260](https://issues.apache.org/jira/browse/CLOUDSTACK-7260) | Management server not responding after some time for Vmware due to Oom 
+[CLOUDSTACK-7260](https://issues.apache.org/jira/browse/CLOUDSTACK-7260) | Management server not responding after some time for Vmware due to Oom
 [CLOUDSTACK-7038](https://issues.apache.org/jira/browse/CLOUDSTACK-7038) | Add mysql client dependency for mgmt server pkg for debian
 [CLOUDSTACK-6892](https://issues.apache.org/jira/browse/CLOUDSTACK-6892) | Create separate package for the mysql HA component
 [CLOUDSTACK-7038](https://issues.apache.org/jira/browse/CLOUDSTACK-7038) | Add mysql client dependency for mgmt server/rpms
@@ -449,12 +449,12 @@
 [CLOUDSTACK-7006](https://issues.apache.org/jira/browse/CLOUDSTACK-7006) | Restore template ID in ROOT volume usages
 [CLOUDSTACK-6747](https://issues.apache.org/jira/browse/CLOUDSTACK-6747) | test to allow all cidrs on other end of vpc
 [CLOUDSTACK-6272](https://issues.apache.org/jira/browse/CLOUDSTACK-6272) | Fix recover/restore VM actions
-[CLOUDSTACK-6927](https://issues.apache.org/jira/browse/CLOUDSTACK-6927) | store virsh list in list instead of querying libvirt 
+[CLOUDSTACK-6927](https://issues.apache.org/jira/browse/CLOUDSTACK-6927) | store virsh list in list instead of querying libvirt
 [CLOUDSTACK-6317](https://issues.apache.org/jira/browse/CLOUDSTACK-6317) | [VMware] Tagged VLAN support broken for Management/Control/Storage traffic
 [CLOUDSTACK-5891](https://issues.apache.org/jira/browse/CLOUDSTACK-5891) | [VMware] If a template has been registered and "cpu.corespersocket=X" ,
 [CLOUDSTACK-6478](https://issues.apache.org/jira/browse/CLOUDSTACK-6478) | Failed to download Template when having 3 SSVM's in one
 [CLOUDSTACK-6464](https://issues.apache.org/jira/browse/CLOUDSTACK-6464) | if guest network type is vlan://untagged, and traffic label is used
-[CLOUDSTACK-6816](https://issues.apache.org/jira/browse/CLOUDSTACK-6816) | bugfix: cloudstack-setup-management make /root directory's permission 0777 
+[CLOUDSTACK-6816](https://issues.apache.org/jira/browse/CLOUDSTACK-6816) | bugfix: cloudstack-setup-management make /root directory's permission 0777
 [CLOUDSTACK-6204](https://issues.apache.org/jira/browse/CLOUDSTACK-6204) | applying missed patch
 [CLOUDSTACK-6472](https://issues.apache.org/jira/browse/CLOUDSTACK-6472) | (4.3 specific) listUsageRecords: Pull information from removed items as well
 [CLOUDSTACK-5976](https://issues.apache.org/jira/browse/CLOUDSTACK-5976) | Typo in "ssh_keypairs" table's foreign key constraints on the Upgraded Setup
@@ -657,11 +657,11 @@
 -------------
 
 This is the second major release of CloudStack from within the Apache Software Foundation, and the
-first major release as a Top-Level Project (TLP). 
+first major release as a Top-Level Project (TLP).
 
 Build Tool Changes:
 
- * The project now uses Maven 3 exclusively to build. 
+ * The project now uses Maven 3 exclusively to build.
 
 New Features:
 * CLOUDSTACK-101: OVS support in KVM
@@ -976,14 +976,14 @@
 * CLOUDSTACK-1845: KVM - storage migration often fails
 * CLOUDSTACK-1846: KVM - storage pools can silently fail to be unregistered, leading to failure to register later
 * CLOUDSTACK-2003: Deleting domain while deleted account is cleaning up leaves VMs expunging forever due to 'Failed to update resource count'
-* CLOUDSTACK-2090: Upgrade from version 4.0.1 to version 4.0.2 triggers the 4.0.0 to 4.0.1. 
+* CLOUDSTACK-2090: Upgrade from version 4.0.1 to version 4.0.2 triggers the 4.0.0 to 4.0.1.
 * CLOUDSTACK-2091: Error in API documentation for 4.0.x.
 
 
 Version 4.0.1-incubating
 ------------------------
 
-This is a bugfix release for Apache CloudStack 4.0.0-incubating, with no new features. 
+This is a bugfix release for Apache CloudStack 4.0.0-incubating, with no new features.
 
 Security Fixes:
 
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index cdfbfe7..bb84e4e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -3,7 +3,7 @@
 
 Summary
 -------
-This document covers how to contribute to the ACS project. ACS uses GitHub PRs to manage code contributions. 
+This document covers how to contribute to the ACS project. ACS uses GitHub PRs to manage code contributions.
 These instructions assume you have a GitHub.com account, so if you don't have one you will have to create one. Your proposed code changes will be published to your own fork of the ACS project and you will submit a Pull Request for your changes to be added.
 
 _Lets get started!!!_
@@ -11,17 +11,17 @@
 Bug fixes
 ---------
 
-It's very important that we can easily track bug fix commits, so their hashes should remain the same in all branches. 
-Therefore, a pull request (PR) that fixes a bug, should be sent against a release branch. 
-This can be either the "current release" or the "previous release", depending on which ones are maintained. 
+It's very important that we can easily track bug fix commits, so their hashes should remain the same in all branches.
+Therefore, a pull request (PR) that fixes a bug, should be sent against a release branch.
+This can be either the "current release" or the "previous release", depending on which ones are maintained.
 Since the goal is a stable main, bug fixes should be "merged forward" to the next branch in order: "previous release" -> "current release" -> main (in other words: old to new)
 
 Developing new features
 -----------------------
 
-Development should be done in a feature branch, branched off of main. 
-Send a PR(steps below) to get it into main (2x LGTM applies). 
-PR will only be merged when main is open, will be held otherwise until main is open again. 
+Development should be done in a feature branch, branched off of main.
+Send a PR(steps below) to get it into main (2x LGTM applies).
+PR will only be merged when main is open, will be held otherwise until main is open again.
 No back porting / cherry-picking features to existing branches!
 
 PendingReleaseNotes file
@@ -33,7 +33,7 @@
 
 Updating the PendingReleaseNotes file is preferably a part of the original Pull Request, but that is up to the developers' discretion.
 
-Fork the code 
+Fork the code
 -------------
 
 In your browser, navigate to: [https://github.com/apache/cloudstack](https://github.com/apache/cloudstack)
@@ -136,4 +136,4 @@
 
 Release Principles
 ------------------
-Detailed information about ACS release principles is available at https://cwiki.apache.org/confluence/display/CLOUDSTACK/Release+principles+for+Apache+CloudStack+4.6+and+up 
+Detailed information about ACS release principles is available at https://cwiki.apache.org/confluence/display/CLOUDSTACK/Release+principles+for+Apache+CloudStack+4.6+and+up
diff --git a/README.md b/README.md
index e193913..f66a4dc 100644
--- a/README.md
+++ b/README.md
@@ -142,7 +142,7 @@
 reside may have restrictions on the import, possession, use, and/or re-export to another
 country, of encryption software. BEFORE using any encryption software, please check your
 country's laws, regulations and policies concerning the import, possession, or use, and
-re-export of encryption software, to see if this is permitted. See [The Wassenaar Arrangement](http://www.wassenaar.org/) 
+re-export of encryption software, to see if this is permitted. See [The Wassenaar Arrangement](http://www.wassenaar.org/)
 for more information.
 
 The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has
diff --git a/agent/bindir/cloud-setup-agent.in b/agent/bindir/cloud-setup-agent.in
index 53c6c2f..18de640 100755
--- a/agent/bindir/cloud-setup-agent.in
+++ b/agent/bindir/cloud-setup-agent.in
@@ -6,9 +6,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
diff --git a/agent/bindir/cloud-ssh.in b/agent/bindir/cloud-ssh.in
index e4b3c14..a5ea975 100644
--- a/agent/bindir/cloud-ssh.in
+++ b/agent/bindir/cloud-ssh.in
@@ -6,9 +6,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
diff --git a/agent/conf/environment.properties.in b/agent/conf/environment.properties.in
index 514161a..b6cc5bb 100644
--- a/agent/conf/environment.properties.in
+++ b/agent/conf/environment.properties.in
@@ -5,9 +5,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
diff --git a/client/bindir/cloud-update-xenserver-licenses.in b/client/bindir/cloud-update-xenserver-licenses.in
index 9ce1898..2be3a08 100755
--- a/client/bindir/cloud-update-xenserver-licenses.in
+++ b/client/bindir/cloud-update-xenserver-licenses.in
@@ -7,9 +7,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
@@ -46,7 +46,7 @@
 #---------------------- option parsing and command line checks ------------------------
 
 
-usage = """%prog <license file> <-a | host names / IP addresses...> 
+usage = """%prog <license file> <-a | host names / IP addresses...>
 
 This command deploys the license file specified in the command line into a specific XenServer host or all XenServer hosts known to the management server."""
 
@@ -88,7 +88,7 @@
 	return creds
 
 class XenServerConfigurator(Thread):
-	
+
 	def __init__(self,host,user,password,keyfiledata):
 		Thread.__init__(self)
 		self.host = host
@@ -99,7 +99,7 @@
 		self.stdout = ""
 		self.stderr = ""
 		self.state = 'initialized'
-		
+
 	def run(self):
 		try:
 			self.state = 'running'
@@ -120,18 +120,18 @@
 			c.close()
 			if self.retval != 0: self.state = 'failed'
 			else: self.state = 'finished'
-			
+
 		except Exception as e:
 			self.state = 'failed'
 			self.retval = e
 			#raise
-	
+
 	def __str__(self):
 		if self.state == 'failed':
 			return "<%s XenServerConfigurator on %s@%s: %s>"%(self.state,self.user,self.host,str(self.retval))
 		else:
 			return "<%s XenServerConfigurator on %s@%s>"%(self.state,self.user,self.host)
-		
+
 #------------- actual code --------------------
 
 (options, args) = parser.parse_args()
@@ -162,7 +162,7 @@
 
 
 for c in configurators: c.start()
-	
+
 for c in configurators:
 	print(c.host + "...", end=' ')
 	c.join()
diff --git a/deps/install-non-oss.sh b/deps/install-non-oss.sh
index c6b91e0..ea40e9a 100755
--- a/deps/install-non-oss.sh
+++ b/deps/install-non-oss.sh
@@ -8,7 +8,7 @@
 # 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
diff --git a/plugins/hypervisors/ovm/src/main/scripts/vm/hypervisor/ovm/configureOvm.sh b/plugins/hypervisors/ovm/src/main/scripts/vm/hypervisor/ovm/configureOvm.sh
index 2cc3a0c..ccd1704 100755
--- a/plugins/hypervisors/ovm/src/main/scripts/vm/hypervisor/ovm/configureOvm.sh
+++ b/plugins/hypervisors/ovm/src/main/scripts/vm/hypervisor/ovm/configureOvm.sh
@@ -6,9 +6,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
diff --git a/plugins/network-elements/juniper-contrail/src/test/resources/mysql_db_start.sh b/plugins/network-elements/juniper-contrail/src/test/resources/mysql_db_start.sh
index 265cdea..86c8bda 100644
--- a/plugins/network-elements/juniper-contrail/src/test/resources/mysql_db_start.sh
+++ b/plugins/network-elements/juniper-contrail/src/test/resources/mysql_db_start.sh
@@ -47,5 +47,5 @@
 echo $db
 
 echo "commands ...."
-echo "to connect(from local host): mysql -h 127.0.0.1 -P "$PORT 
+echo "to connect(from local host): mysql -h 127.0.0.1 -P "$PORT
 echo "to stop: mysqladmin -S /tmp/mysql"$PORT"/mysqld.sock shutdown -u root"
diff --git a/plugins/storage/volume/storpool/README.md b/plugins/storage/volume/storpool/README.md
index 7752234..e5b8478 100644
--- a/plugins/storage/volume/storpool/README.md
+++ b/plugins/storage/volume/storpool/README.md
@@ -294,7 +294,7 @@
 ### Creating ROOT volume from templates
 
 When creating the first volume based on the given template, if snapshot of the template does not exists on StorPool it will be first downloaded (cached) to PRIMARY storage.
-This is mapped to a StorPool snapshot so, creating succecutive volumes from the same template does not incur additional 
+This is mapped to a StorPool snapshot so, creating succecutive volumes from the same template does not incur additional
 copying of data to PRIMARY storage.
 
 This cached snapshot is garbage collected when the original template is deleted from CloudStack. This cleanup is done
diff --git a/python/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in b/python/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in
index 4944fc0..546ec1c 100755
--- a/python/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in
+++ b/python/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in
@@ -6,9 +6,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
diff --git a/python/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in b/python/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in
index 28d5a11..6811c21 100755
--- a/python/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in
+++ b/python/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in
@@ -6,9 +6,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
diff --git a/python/distro/opensuse/SYSCONFDIR/init.d/cloud-ipallocator.in b/python/distro/opensuse/SYSCONFDIR/init.d/cloud-ipallocator.in
index de68534..9d201a2 100755
--- a/python/distro/opensuse/SYSCONFDIR/init.d/cloud-ipallocator.in
+++ b/python/distro/opensuse/SYSCONFDIR/init.d/cloud-ipallocator.in
@@ -6,9 +6,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
diff --git a/python/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in b/python/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in
index 28d5a11..6811c21 100644
--- a/python/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in
+++ b/python/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in
@@ -6,9 +6,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
diff --git a/python/distro/sles/SYSCONFDIR/init.d/cloud-ipallocator.in b/python/distro/sles/SYSCONFDIR/init.d/cloud-ipallocator.in
index de68534..9d201a2 100755
--- a/python/distro/sles/SYSCONFDIR/init.d/cloud-ipallocator.in
+++ b/python/distro/sles/SYSCONFDIR/init.d/cloud-ipallocator.in
@@ -6,9 +6,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
diff --git a/python/distro/ubuntu/SYSCONFDIR/init.d/cloud-ipallocator.in b/python/distro/ubuntu/SYSCONFDIR/init.d/cloud-ipallocator.in
index 4acb11a..f9a855b 100755
--- a/python/distro/ubuntu/SYSCONFDIR/init.d/cloud-ipallocator.in
+++ b/python/distro/ubuntu/SYSCONFDIR/init.d/cloud-ipallocator.in
@@ -6,9 +6,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
@@ -52,7 +52,7 @@
 		log_end_msg 1
 		exit 1
 	fi
- 
+
 	if start-stop-daemon --start --quiet \
 		--pidfile "$PIDFILE" \
 		--exec "$DAEMONIZE" -- -n "$SHORTNAME" -p "$PIDFILE" -l "$LOGFILE" "$PROG" $OPTIONS
diff --git a/scripts/installer/createtmplt.sh b/scripts/installer/createtmplt.sh
index 2d16430..db3cfd7 100755
--- a/scripts/installer/createtmplt.sh
+++ b/scripts/installer/createtmplt.sh
@@ -6,9 +6,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
@@ -51,7 +51,7 @@
   esac
   echo  "$1  $2" | $digestalgo  -c --status
   #printf "$1\t$2" | $digestalgo  -c --status
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Checksum failed, not proceeding with install\n"
     exit 3
@@ -92,12 +92,12 @@
 	;;
   esac
 
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to uncompress file, exiting "
-    exit 1 
+    exit 1
   fi
- 
+
   mv $tmpfile $imgfile
   printf "$imgfile"
 
@@ -184,10 +184,10 @@
   tmpltfs=${tmpltfs:1}
 fi
 
-if [ ! -d /$tmpltfs ] 
+if [ ! -d /$tmpltfs ]
 then
   zfs create -p $tmpltfs
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to create user fs $tmpltfs\n" >&2
     exit 1
@@ -203,7 +203,7 @@
 tmpltimg2=$(uncompress $tmpltimg)
 tmpltimg2=$(untar $tmpltimg2 /$tmpltfs vmi-root)
 
-if [ ! -f $tmpltimg2 ] 
+if [ ! -f $tmpltimg2 ]
 then
   rollback_if_needed $tmpltfs 2 "root disk file $tmpltimg doesn't exist\n"
   exit 3
@@ -217,15 +217,15 @@
 
 #determine source file size -- it needs to be less than or equal to volsize
 imgsize=$(ls -lh $tmpltimg2| awk -F" " '{print $5}')
-if [ ${imgsize:(-1)} == G ] 
+if [ ${imgsize:(-1)} == G ]
 then
-  imgsize=${imgsize%G} #strip out the G 
+  imgsize=${imgsize%G} #strip out the G
   imgsize=${imgsize%.*} #...and any decimal part
   let imgsize=imgsize+1 # add 1 to compensate for decimal part
   volsizetmp=${volsize%G}
   if [ $volsizetmp -lt $imgsize ]
   then
-    volsize=${imgsize}G  
+    volsize=${imgsize}G
   fi
 fi
 
@@ -234,11 +234,11 @@
 create_from_file $tmpltfs $tmpltimg2 $tgtfile  $volsize $cleanup
 
 tmpltswap=$(ls -lh /$tmpltfs | grep swap)
-if [ $? -eq 0 ] 
+if [ $? -eq 0 ]
 then
   swapsize=$(echo $tmpltswap | awk '{print $5}')
   tmpltswap=$(echo $tmpltswap | awk '{print $NF}')
-  tmpltswap=/${tmpltfs}/${tmpltswap} 
+  tmpltswap=/${tmpltfs}/${tmpltswap}
   tgtfile=${tmpltfs}/vmi-swap-${tmpltname}
   create_from_file $tmpltfs $tmpltswap $tgtfile $swapsize $cleanup
 fi
diff --git a/scripts/installer/createvolume.sh b/scripts/installer/createvolume.sh
index 15847c5..52792e9 100755
--- a/scripts/installer/createvolume.sh
+++ b/scripts/installer/createvolume.sh
@@ -6,9 +6,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
@@ -93,12 +93,12 @@
 	;;
   esac
 
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to uncompress file, exiting "
-    exit 1 
+    exit 1
   fi
- 
+
   mv $tmpfile $imgfile
   printf "$imgfile"
 
@@ -185,10 +185,10 @@
   volfs=${volfs:1}
 fi
 
-if [ ! -d /$volfs ] 
+if [ ! -d /$volfs ]
 then
   zfs create -p $volfs
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to create user fs $volfs\n" >&2
     exit 1
@@ -204,7 +204,7 @@
 volimg2=$(uncompress $volimg)
 volimg2=$(untar $volimg2 /$volfs vmi-root)
 
-if [ ! -f $volimg2 ] 
+if [ ! -f $volimg2 ]
 then
   rollback_if_needed $volfs 2 "root disk file $volimg doesn't exist\n"
   exit 3
@@ -218,15 +218,15 @@
 
 #determine source file size -- it needs to be less than or equal to volsize
 imgsize=$(ls -lh $volimg2| awk -F" " '{print $5}')
-if [ ${imgsize:(-1)} == G ] 
+if [ ${imgsize:(-1)} == G ]
 then
-  imgsize=${imgsize%G} #strip out the G 
+  imgsize=${imgsize%G} #strip out the G
   imgsize=${imgsize%.*} #...and any decimal part
   let imgsize=imgsize+1 # add 1 to compensate for decimal part
   volsizetmp=${volsize%G}
   if [ $volsizetmp -lt $imgsize ]
   then
-    volsize=${imgsize}G  
+    volsize=${imgsize}G
   fi
 fi
 
@@ -235,11 +235,11 @@
 create_from_file $volfs $volimg2 $tgtfile  $volsize $cleanup
 
 volswap=$(ls -lh /$volfs | grep swap)
-if [ $? -eq 0 ] 
+if [ $? -eq 0 ]
 then
   swapsize=$(echo $volswap | awk '{print $5}')
   volswap=$(echo $volswap | awk '{print $NF}')
-  volswap=/${volfs}/${volswap} 
+  volswap=/${volfs}/${volswap}
   tgtfile=${volfs}/vmi-swap-${volname}
   create_from_file $volfs $volswap $tgtfile $swapsize $cleanup
 fi
diff --git a/scripts/installer/installcentos.sh b/scripts/installer/installcentos.sh
index e68e057..b16fadc 100755
--- a/scripts/installer/installcentos.sh
+++ b/scripts/installer/installcentos.sh
@@ -6,9 +6,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
@@ -38,7 +38,7 @@
   		;;
   c)	cflag=1
   		create_tmplt_path="$OPTARG"
-  		;;    
+  		;;
   ?)	usage
 		exit 2
 		;;
@@ -47,14 +47,14 @@
 
 shift $(($OPTIND - 1))
 
-if [ "$tflag" != "1" ] || [ "$cflag" != "1" ] 
+if [ "$tflag" != "1" ] || [ "$cflag" != "1" ]
 then
  usage
  exit 2
 fi
 
 tmpltfs=$template_location/public/os/centos53-x86_64
-if [ "$fflag" == "1" ] 
+if [ "$fflag" == "1" ]
 then
   zfs destroy -Rr $tmpltfs 2> /dev/null
 fi
diff --git a/scripts/installer/installdomp.sh b/scripts/installer/installdomp.sh
index 79ea9fd..9c7ab72 100755
--- a/scripts/installer/installdomp.sh
+++ b/scripts/installer/installdomp.sh
@@ -6,9 +6,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
@@ -47,7 +47,7 @@
 fi
 
 tmpltfs=$1/private/u000000/os/consoleproxy
-if [ "$fflag" == "1" ] 
+if [ "$fflag" == "1" ]
 then
   zfs destroy -r $tmpltfs 2> /dev/null
 fi
diff --git a/scripts/installer/run_installer.sh b/scripts/installer/run_installer.sh
index 8452e37..3a96c79 100755
--- a/scripts/installer/run_installer.sh
+++ b/scripts/installer/run_installer.sh
@@ -6,9 +6,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
@@ -32,7 +32,7 @@
 fi
 
 if [ "$VMOPS_HOME" == "" ]
-then 
+then
 	VMOPS_HOME="/usr/local/vmops"
 fi
 
diff --git a/scripts/network/domr/router_proxy.sh b/scripts/network/domr/router_proxy.sh
index 945ca96..550ec6d 100755
--- a/scripts/network/domr/router_proxy.sh
+++ b/scripts/network/domr/router_proxy.sh
@@ -6,9 +6,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
@@ -16,7 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# used as a proxy to call script inside virtual router 
+# used as a proxy to call script inside virtual router
 
 #set -x
 
diff --git a/scripts/network/exdhcp/dnsmasq_edithosts.sh b/scripts/network/exdhcp/dnsmasq_edithosts.sh
index 7990356..f0744a9 100755
--- a/scripts/network/exdhcp/dnsmasq_edithosts.sh
+++ b/scripts/network/exdhcp/dnsmasq_edithosts.sh
@@ -6,9 +6,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
@@ -41,9 +41,9 @@
 [ ! -f /etc/dhcphosts.txt ] && touch /etc/dhcphosts.txt
 [ ! -f /var/lib/misc/dnsmasq.leases ] && touch /var/lib/misc/dnsmasq.leases
 
-sed -i  /$1/d /etc/dhcphosts.txt 
-sed -i  /$2,/d /etc/dhcphosts.txt 
-sed -i  /$3,/d /etc/dhcphosts.txt 
+sed -i  /$1/d /etc/dhcphosts.txt
+sed -i  /$2,/d /etc/dhcphosts.txt
+sed -i  /$3,/d /etc/dhcphosts.txt
 
 echo "$1,$2,$3,infinite" >>/etc/dhcphosts.txt
 
@@ -54,9 +54,9 @@
 fi
 
 #delete leases to supplied mac and ip addresses
-sed -i  /$1/d /var/lib/misc/dnsmasq.leases 
-sed -i  /"$2 "/d /var/lib/misc/dnsmasq.leases 
-sed -i  /"$3 "/d /var/lib/misc/dnsmasq.leases 
+sed -i  /$1/d /var/lib/misc/dnsmasq.leases
+sed -i  /"$2 "/d /var/lib/misc/dnsmasq.leases
+sed -i  /"$3 "/d /var/lib/misc/dnsmasq.leases
 
 #put in the new entry
 echo "0 $1 $2 $3 *" >> /var/lib/misc/dnsmasq.leases
diff --git a/scripts/network/exdhcp/prepare_dhcpd.sh b/scripts/network/exdhcp/prepare_dhcpd.sh
index e49d0fa..657fdfe 100755
--- a/scripts/network/exdhcp/prepare_dhcpd.sh
+++ b/scripts/network/exdhcp/prepare_dhcpd.sh
@@ -6,9 +6,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
diff --git a/scripts/network/exdhcp/prepare_dnsmasq.sh b/scripts/network/exdhcp/prepare_dnsmasq.sh
index 70aa587..5c49634 100755
--- a/scripts/network/exdhcp/prepare_dnsmasq.sh
+++ b/scripts/network/exdhcp/prepare_dnsmasq.sh
@@ -6,9 +6,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
@@ -129,11 +129,11 @@
 config_dnsmasq "
 # Send options to hosts which ask for a DHCP lease.
 # See RFC 2132 for details of available options.
-# Common options can be given to dnsmasq by name: 
+# Common options can be given to dnsmasq by name:
 # run \"dnsmasq --help dhcp\" to get a list.
 # Note that all the common settings, such as netmask and
 # broadcast address, DNS server and default route, are given
-# sane defaults by dnsmasq. You very likely will not need 
+# sane defaults by dnsmasq. You very likely will not need
 # any dhcp-options. If you use Windows clients and Samba, there
 # are some options which are recommended, they are detailed at the
 # end of this section.
diff --git a/scripts/storage/checkchildren.sh b/scripts/storage/checkchildren.sh
index 55122d4..4185a7c 100755
--- a/scripts/storage/checkchildren.sh
+++ b/scripts/storage/checkchildren.sh
@@ -6,9 +6,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
diff --git a/scripts/storage/installIso.sh b/scripts/storage/installIso.sh
index fd301bc..89744ac 100755
--- a/scripts/storage/installIso.sh
+++ b/scripts/storage/installIso.sh
@@ -6,9 +6,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
@@ -29,7 +29,7 @@
 
 verify_cksum() {
   echo  "$1  $2" | md5sum  -c --status
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Checksum failed, not proceeding with install\n"
     exit 3
@@ -44,7 +44,7 @@
 
   mv $isofile /$isofs/$tmpltname
 
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Move operation failed, iso $isofile not installed\n"
     exit 4
@@ -55,7 +55,7 @@
   isofs=$isofs/$file
   mp=${isofs%/iso/*}
   mp=/$mp/iso
-  path=${isofs:${#mp}}  
+  path=${isofs:${#mp}}
   pushd $mp
   ln -s $path $file
   popd
@@ -108,10 +108,10 @@
   isofs=${isofs:1}
 fi
 
-if [ ! -d /$isofs ] 
+if [ ! -d /$isofs ]
 then
   mkdir -p /$isofs
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to create iso fs $isofs\n" >&2
     exit 1
diff --git a/scripts/storage/qcow2/create_private_template.sh b/scripts/storage/qcow2/create_private_template.sh
index 8e9e26c..06bf79d 100755
--- a/scripts/storage/qcow2/create_private_template.sh
+++ b/scripts/storage/qcow2/create_private_template.sh
@@ -6,9 +6,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
@@ -16,7 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
- 
+
 
 # $Id: create_private_template.sh 9804 2010-06-22 18:36:49Z alex $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/create_private_template.sh $
 # create_private_template.sh -- create a private template from a snapshot
@@ -31,7 +31,7 @@
   local fspath=$1
   local destpath=$2
 
-  # if backing image exists, we need to combine them, otherwise 
+  # if backing image exists, we need to combine them, otherwise
   # copy the image to preserve snapshots/compression
   if $qemu_img info "$tmpltimg" | grep -q backing; then
     qemu-img convert -O qcow2 /$fspath  $destpath
diff --git a/scripts/storage/qcow2/createtmplt.sh b/scripts/storage/qcow2/createtmplt.sh
index b05550c..4bb955e 100755
--- a/scripts/storage/qcow2/createtmplt.sh
+++ b/scripts/storage/qcow2/createtmplt.sh
@@ -6,9 +6,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
@@ -70,12 +70,12 @@
 	;;
   esac
 
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to uncompress file, exiting "
-    exit 1 
+    exit 1
   fi
- 
+
   mv $tmpfile $imgfile
   printf "$imgfile"
 
@@ -89,7 +89,7 @@
   if [ -b $tmpltimg ]; then
       $qemu_img convert -f raw -O qcow2 "$tmpltimg" /$tmpltfs/$tmpltname
   else
-    # if backing image exists, we need to combine them, otherwise 
+    # if backing image exists, we need to combine them, otherwise
     # copy the image to preserve snapshots/compression
     if $qemu_img info "$tmpltimg" | grep -q backing; then
       $qemu_img convert -f qcow2 -O qcow2 "$tmpltimg" /$tmpltfs/$tmpltname >& /dev/null
@@ -97,7 +97,7 @@
       cp -f $tmpltimg /$tmpltfs/$tmpltname
     fi
   fi
-  
+
   if [ "$cleanup" == "true" ]
   then
     rm -f "$tmpltimg"
@@ -161,17 +161,17 @@
 done
 
 
-if [ ! -d /$tmpltfs ] 
+if [ ! -d /$tmpltfs ]
 then
   mkdir -p /$tmpltfs
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to create user fs $tmpltfs\n" >&2
     exit 1
   fi
 fi
 
-if [ ! -f $tmpltimg -a ! -b $tmpltimg ] 
+if [ ! -f $tmpltimg -a ! -b $tmpltimg ]
 then
   printf "root disk file $tmpltimg doesn't exist\n"
   exit 3
diff --git a/scripts/storage/qcow2/createvm.sh b/scripts/storage/qcow2/createvm.sh
index 0971c9b..e3a83ae 100755
--- a/scripts/storage/qcow2/createvm.sh
+++ b/scripts/storage/qcow2/createvm.sh
@@ -6,9 +6,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
@@ -18,11 +18,11 @@
 
 
 # $Id: createvm.sh 10292 2010-07-07 00:24:04Z edison $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/createvm.sh $
-# createvm.sh -- create a vm image 
+# createvm.sh -- create a vm image
 
 usage() {
   echo "Usage (clone VM from template): createvm.sh -t <template dir>  -i <rootdisk dir> -f <datadisk folder> -n <datadisk name> -s <datadisk size in GB>\n\
-Usage (create blank rootdisk): createvm.sh -i <rootdisk dir> -S <rootdisk size in GB> \n" 
+Usage (create blank rootdisk): createvm.sh -i <rootdisk dir> -S <rootdisk size in GB> \n"
 }
 
 check_params() {
@@ -43,7 +43,7 @@
       return 1
     fi
   fi
-  
+
   return 0
 }
 
@@ -53,7 +53,7 @@
   local rootdiskfolder=$3
   local datadiskfolder=$4
   local datadiskname=$5
-  
+
   if [ $return_code -gt 0 ]
   then
     cleanup_disks $rootdiskfolder $datadiskfolder $datadiskname
@@ -71,24 +71,24 @@
   then
     datadiskpath="${datadiskfolder}/${datadiskname}"
   fi
-  
+
   if [ "$rootdiskfolder" != "" ] && [ -d $rootdiskfolder ]
   then
     rm -rf $rootdiskfolder
   fi
-  
+
   if [ "$datadiskpath" != "" ] && [ -f $datadiskpath ]
   then
     rm $datadiskpath
   fi
-  
+
   return 0
 }
 
 exit_if_error() {
   local return_code=$1
   local msg=$2
-  
+
   if [ $return_code -gt 0 ]
   then
     printf "${msg}\n"
@@ -98,7 +98,7 @@
 
 make_folder() {
   local folder=$1
-  
+
   if [ ! -d ${folder} ]
   then
     mkdir -p ${folder}
@@ -121,9 +121,9 @@
 check_datadisk() {
   local datadiskfolder=$1
   local datadiskname=$2
-  
+
   make_folder $datadiskfolder
-  
+
   if [ -f ${datadiskfolder}/${datadiskname} ]
   then
     return 1
@@ -134,12 +134,12 @@
 
 strip_leading_slash() {
   local folder=$1
-  
+
   if [ ${folder:0:1} != / ]
   then
     folder=/$folder
   fi
-  
+
   echo $folder
 }
 
@@ -149,7 +149,7 @@
 
   curDir=$(pwd)
   cd $rootdiskfolder
-  qemu-img create -f qcow2 -b $templatepath ${rootdiskfolder}/rootdisk	
+  qemu-img create -f qcow2 -b $templatepath ${rootdiskfolder}/rootdisk
   cd $curDir
 
   return $?
@@ -158,9 +158,9 @@
 create_blank_rootdisk() {
   local rootdiskfolder=$1
   local rootdisksize=$2
-  
+
   rootdisksize=$(convert_size_to_gb $rootdisksize)
-  
+
   if [ $? -gt 0 ]
   then
     return 1
@@ -176,27 +176,27 @@
   local datadiskname=$2
   local datadisksize=$3
   local diskfmt=$4
-  
+
   datadisksize=$(convert_size_to_gb $datadisksize)
-  
+
   if [ $? -gt 0 ]
   then
     return 1
   fi
 
   qemu-img create -f $diskfmt ${datadiskfolder}/${datadiskname} $datadisksize
-  
+
   return $?
 }
 
 convert_size_to_gb() {
   local size=$1
-  
+
   suffix=${size:(-1)}
   case $suffix in
     M)
         ;;
-    G)   
+    G)
          ;;
     [0-9])   size=${size}G
          ;;
@@ -204,7 +204,7 @@
          return 1
          ;;
   esac
-  
+
   echo $size
   return 0
 }
@@ -262,7 +262,7 @@
   		exit_if_error $? "Failed to clone template $templatepath to $rootdiskfolder/rootdisk."
 	else
   		# A template path was not passed in, so create a blank rootdisk at the rootdisk folder
-  		create_blank_rootdisk $rootdiskfolder $rootdisksize 
+  		create_blank_rootdisk $rootdiskfolder $rootdisksize
   		exit_if_error $? "Failed to create a blank rootdisk at $rootdiskfolder/rootdisk."
 	fi
 fi
@@ -270,8 +270,8 @@
 if [ -n "$datadisksize" ]
 then
   # Create the datadisk folder if necessary, and make sure there is no existing datadisk there
-  check_datadisk $datadiskfolder $datadiskname 
-  cleanup_and_exit_if_error $? "Failed to create datadisk in $datadiskfolder; datadisk with $datadiskname already exists." $rootdiskfolder 
+  check_datadisk $datadiskfolder $datadiskname
+  cleanup_and_exit_if_error $? "Failed to create datadisk in $datadiskfolder; datadisk with $datadiskname already exists." $rootdiskfolder
 
   # Create the datadisk
   create_datadisk $datadiskfolder $datadiskname $datadisksize qcow2
@@ -285,7 +285,7 @@
     retry=10
     while [ $retry -gt 0 ]
     do
-	success=$(losetup -a |grep $loopdev)		
+	success=$(losetup -a |grep $loopdev)
 	if [ $? -eq 0 ]
 	then
 		break
@@ -300,7 +300,7 @@
     	losetup -d $loopdev
         if [ $? -eq 0 ]
 	then
-       		break 
+       		break
 	fi
         retry=$(($retry-1))
 	sleep 1
diff --git a/scripts/storage/qcow2/createvolume.sh b/scripts/storage/qcow2/createvolume.sh
index 033cc91..ff04ee3 100755
--- a/scripts/storage/qcow2/createvolume.sh
+++ b/scripts/storage/qcow2/createvolume.sh
@@ -6,9 +6,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
@@ -16,7 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
- 
+
 
 # $Id: createvol.sh 11601 2010-08-11 17:26:15Z kris $ $HeadURL: svn://svn.lab.vmops.com/repos/branches/2.1.refactor/java/scripts/storage/qcow2/createvol.sh $
 # createvol.sh -- install a volume
@@ -71,12 +71,12 @@
 	;;
   esac
 
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to uncompress file, exiting "
-    exit 1 
+    exit 1
   fi
- 
+
   mv $tmpfile $imgfile
   printf "$imgfile"
 
@@ -98,7 +98,7 @@
       cp -f $volimg /$volfs/$volname
     fi
   fi
-  
+
   if [ "$cleanup" == "true" ]
   then
     rm -f "$volimg"
@@ -162,17 +162,17 @@
 done
 
 
-if [ ! -d /$volfs ] 
+if [ ! -d /$volfs ]
 then
   mkdir -p /$volfs
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to create user fs $volfs\n" >&2
     exit 1
   fi
 fi
 
-if [ ! -f $volimg -a ! -b $volimg ] 
+if [ ! -f $volimg -a ! -b $volimg ]
 then
   printf "root disk file $volimg doesn't exist\n"
   exit 3
diff --git a/scripts/storage/qcow2/delvm.sh b/scripts/storage/qcow2/delvm.sh
index 6c8341c..6bc6d3b 100755
--- a/scripts/storage/qcow2/delvm.sh
+++ b/scripts/storage/qcow2/delvm.sh
@@ -6,9 +6,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
@@ -54,20 +54,20 @@
 fi
 
 
-if [ "$iflag" == 1 ] 
+if [ "$iflag" == 1 ]
 then
   rm -rf $instancefs
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to destroy instance fs\n" >&2
     exit 5
   fi
 fi
 
-if [ "$uflag" == 1 ] 
+if [ "$uflag" == 1 ]
 then
-  rm -rf $userfs  
-  if [ $? -gt 0 ] 
+  rm -rf $userfs
+  if [ $? -gt 0 ]
   then
     printf "Failed to destroy user fs\n" >&2
     exit 5
diff --git a/scripts/storage/qcow2/get_domr_kernel.sh b/scripts/storage/qcow2/get_domr_kernel.sh
index d9f7f9d..8d59560 100755
--- a/scripts/storage/qcow2/get_domr_kernel.sh
+++ b/scripts/storage/qcow2/get_domr_kernel.sh
@@ -6,9 +6,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
@@ -29,18 +29,18 @@
    local nbd_loaded=$?
    if [ $nbd_loaded -ne 0 ]
    then
-        modprobe nbd max_part=8 &> /dev/null 
+        modprobe nbd max_part=8 &> /dev/null
         if [ $? -ne 0 ]
         then
             printf "No nbd module installed, failed to mount qcow2 image\n"
             return 1
         fi
     fi
-    
+
     qemu-nbd -c /dev/nbd0 $disk &> /dev/null
     if [ $? -ne 0 ]
     then
-        printf "failed to create /dev/nbd0\n"   
+        printf "failed to create /dev/nbd0\n"
         return 2
     fi
 
@@ -56,7 +56,7 @@
         fi
         retry=$(($retry-1))
     done
-        
+
 
     if [ $retry -eq 0 ]
     then
diff --git a/scripts/storage/qcow2/get_iqn.sh b/scripts/storage/qcow2/get_iqn.sh
index c8cb4c0..452f4be 100755
--- a/scripts/storage/qcow2/get_iqn.sh
+++ b/scripts/storage/qcow2/get_iqn.sh
@@ -6,9 +6,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
diff --git a/scripts/storage/qcow2/importmpl.sh b/scripts/storage/qcow2/importmpl.sh
index 67eefa8..075a1a5 100755
--- a/scripts/storage/qcow2/importmpl.sh
+++ b/scripts/storage/qcow2/importmpl.sh
@@ -6,9 +6,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
@@ -49,7 +49,7 @@
   local fileName=$5
   virtualsize=$(qemu-img info $tmplfile|grep virtual |awk '{print $4}'|cut -d \( -f 2)
   disksize=$(ls -l $tmplfile|awk '{print $5}')
-  
+
   echo "qcow2=true" >> $metaFile
   echo "id=$id" >> $metaFile
   echo "public=true" >> $metaFile
@@ -91,31 +91,31 @@
   exit 2
 fi
 
-if [[ "$uflag" != "1" && "$rflag" == "1" && ! -f $rttmplt ]] 
+if [[ "$uflag" != "1" && "$rflag" == "1" && ! -f $rttmplt ]]
 then
   echo "template image file $rttmplt doesn't exist"
   exit 3
 fi
 
-if [[ "$uflag" != "1" && "$vflag" == "1" && ! -f $vmtmplt ]] 
+if [[ "$uflag" != "1" && "$vflag" == "1" && ! -f $vmtmplt ]]
 then
   echo "template image file $vmtmplt doesn't exist"
   exit 3
 fi
 
-if [[ "$uflag" == "1" && "$rflag" != "1" ]] 
+if [[ "$uflag" == "1" && "$rflag" != "1" ]]
 then
   rttmplt=http://download.cloudstack.org/templates/builtin/a88232bf-6a18-38e7-aeee-c1702725079f.qcow2.bz2
   echo "download routing template from $rttmplt"
 fi
 
-if [[ "$uflag" == "1" && "$vflag" != "1" ]] 
+if [[ "$uflag" == "1" && "$vflag" != "1" ]]
 then
   vmtmplt=http://download.cloudstack.org/templates/builtin/eec2209b-9875-3c8d-92be-c001bd8a0faf.qcow2.bz2
   echo "download cnetos template from $vmtmplt"
 fi
 
-if [ ! -d $mntpoint ] 
+if [ ! -d $mntpoint ]
 then
   echo "mount point $mntpoint doesn't exist\n"
   exit 4
@@ -182,7 +182,7 @@
 tmpfilert=$(dirname $0)/$localfilert
 tmpfilevm=$(dirname $0)/$localfilevm
 if [ "$uflag" == "1" ]
-then 
+then
 downloadImage $tmpfilert $rttmplt
 downloadImage $tmpfilevm $vmtmplt
 fi
@@ -195,7 +195,7 @@
     printf "Failed to create temporary file in directory $(dirname $0) -- is it read-only or full?\n"
     exit 6
   fi
-  cp $vmtmplt $tmpfilevm 
+  cp $vmtmplt $tmpfilevm
   if [ $? -ne 0 ]
   then
     printf "Failed to create temporary file in directory $(dirname $0) -- is it read-only or full?\n"
diff --git a/scripts/storage/qcow2/listvmdisk.sh b/scripts/storage/qcow2/listvmdisk.sh
index 40932a2..c5efa8d 100755
--- a/scripts/storage/qcow2/listvmdisk.sh
+++ b/scripts/storage/qcow2/listvmdisk.sh
@@ -6,9 +6,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
@@ -58,25 +58,25 @@
 
 
 
-if [ "$rflag" == 1 ] 
+if [ "$rflag" == 1 ]
 then
   find $instancefs -name rootdisk
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     exit 5
   fi
   exit 0
 fi
 
-if [ "$dflag" == 1 ] 
+if [ "$dflag" == 1 ]
 then
   if [[ $disknum -eq 0 ]]
-  then 
+  then
     find $instancefs -name datadisk
-  else 
+  else
     find $instancefs -name datadisk${disknum}
   fi
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     exit 6
   fi
diff --git a/scripts/storage/qcow2/listvmdisksize.sh b/scripts/storage/qcow2/listvmdisksize.sh
index 2082558..4c6506f 100755
--- a/scripts/storage/qcow2/listvmdisksize.sh
+++ b/scripts/storage/qcow2/listvmdisksize.sh
@@ -6,9 +6,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
@@ -16,7 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
- 
+
 
 # $Id: listvmdisksize.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/listvmdisksize.sh $
 # listvmdisksize.sh -- list disk sizes of a VM
@@ -56,7 +56,7 @@
 		;;
   t)	tflag=1
 		;;
-  a)	aflag=1		
+  a)	aflag=1
 		;;
   ?)	usage
 		exit 2
@@ -71,11 +71,11 @@
 fi
 
 
-if [ "$tflag" == 1 ] 
+if [ "$tflag" == 1 ]
 then
   # Find the virtual size of the disk image
   size_in_bytes=$(qemu-img info /$diskfs | grep "virtual size" | awk '{print $4}')
-  
+
   # Strip off the leading '('
   size_in_bytes=${size_in_bytes:1}
 else
diff --git a/scripts/storage/qcow2/listvmtmplt.sh b/scripts/storage/qcow2/listvmtmplt.sh
index 86e8903..db49dfd 100755
--- a/scripts/storage/qcow2/listvmtmplt.sh
+++ b/scripts/storage/qcow2/listvmtmplt.sh
@@ -6,9 +6,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
@@ -16,7 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
- 
+
 
 # $Id: listvmtmplt.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/listvmtmplt.sh $
 # listtmplt.sh -- list templates under a directory
@@ -51,7 +51,7 @@
 
 
 for i in $(find /$rootdir -name template.properties );
-do  
+do
   d=$(dirname $i)
   filename=$(grep "filename" $i | awk -F"=" '{print $NF}')
   size=$(grep "virtualsize" $i | awk -F"=" '{print $NF}')
@@ -59,7 +59,7 @@
   then
     d=$d/$filename/$size
   fi
-  echo ${d#/} #remove leading slash 
+  echo ${d#/} #remove leading slash
 done
 
 exit 0
diff --git a/scripts/storage/qcow2/listvolume.sh b/scripts/storage/qcow2/listvolume.sh
index b951b21a..e15a73d 100755
--- a/scripts/storage/qcow2/listvolume.sh
+++ b/scripts/storage/qcow2/listvolume.sh
@@ -6,9 +6,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
@@ -16,7 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
- 
+
 
 # $Id: listvmtmplt.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/listvmtmplt.sh $
 # listtmplt.sh -- list volumes under a directory
@@ -51,7 +51,7 @@
 
 
 for i in $(find /$rootdir -name volume.properties );
-do  
+do
   d=$(dirname $i)
   filename=$(grep "filename" $i | awk -F"=" '{print $NF}')
   size=$(grep "virtualsize" $i | awk -F"=" '{print $NF}')
@@ -59,7 +59,7 @@
   then
     d=$d/$filename/$size
   fi
-  echo ${d#/} #remove leading slash 
+  echo ${d#/} #remove leading slash
 done
 
 exit 0
diff --git a/scripts/storage/qcow2/managevolume.sh b/scripts/storage/qcow2/managevolume.sh
index 1f53047..672ca4c 100755
--- a/scripts/storage/qcow2/managevolume.sh
+++ b/scripts/storage/qcow2/managevolume.sh
@@ -6,9 +6,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
@@ -16,10 +16,10 @@
 # specific language governing permissions and limitations
 # under the License.
 
- 
+
 
 # $Id: managevolume.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/managevolume.sh $
-# modifyvolume.sh -- add or delete a disk volume 
+# modifyvolume.sh -- add or delete a disk volume
 
 usage() {
   echo "Usage: modifydisk.sh -f <folder of volume> -p <path of volume> -s <size of volume> [-d <delete>] \n"
@@ -38,7 +38,7 @@
   local return_code=$1
   local msg=$2
   local path=$3
-  
+
   if [ $return_code -gt 0 ]
   then
     delete_disk $path
@@ -49,7 +49,7 @@
 exit_if_error() {
   local return_code=$1
   local msg=$2
-  
+
   if [ $return_code -gt 0 ]
   then
     printf "${msg}\n"
@@ -59,7 +59,7 @@
 
 make_folder() {
   local folder=$1
-  
+
   if [ ! -d ${folder} ]
   then
     mkdir -p ${folder}
@@ -69,9 +69,9 @@
 check_disk() {
   local folder=$1
   local path=$2
-  
+
   make_folder $folder
-  
+
   if [ -f $path ]
   then
     return 1
@@ -82,37 +82,37 @@
 
 delete_disk() {
   local path=$1
-  
+
   if [ -f $path ]
   then
     rm $path
   fi
-  
+
   return 0
 }
 
 create_disk() {
   local path=$1
   local size=$2
-  
+
   size=$(convert_size_to_gb $size)
-  
+
   if [ $? -gt 0 ]
   then
     return 1
   fi
 
   qemu-img create -f qcow2 $path $size
-  
+
   return $?
 }
 
 convert_size_to_gb() {
   local size=$1
-  
+
   suffix=${size:(-1)}
   case $suffix in
-    G)   
+    G)
          ;;
     [0-9])   size=${size}G
          ;;
@@ -120,7 +120,7 @@
          return 1
          ;;
   esac
-  
+
   echo $size
   return 0
 }
@@ -159,20 +159,20 @@
 if [ "$dflag" == "0" ]
 then
   # Add the volume
-  
+
   # Create the folder if necessary, and make sure there is no existing disk there
   check_disk $folder $path
   cleanup_and_exit_if_error $? "Failed to create disk at $path; path already exists." $path
-  
+
   # Create the disk
   create_disk $path $size
   cleanup_and_exit_if_error $? "Failed to create disk at $path of size $datadisksize." $path
-  
+
 else
   # Delete the volume
-  
+
   delete_disk $path
-  
+
 fi
 
 exit 0
diff --git a/scripts/storage/secondary/create_privatetemplate_from_snapshot_xen.sh b/scripts/storage/secondary/create_privatetemplate_from_snapshot_xen.sh
index 309bcbd..85b7195 100755
--- a/scripts/storage/secondary/create_privatetemplate_from_snapshot_xen.sh
+++ b/scripts/storage/secondary/create_privatetemplate_from_snapshot_xen.sh
@@ -6,9 +6,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
@@ -17,9 +17,9 @@
 # under the License.
 
 #set -x
- 
+
 usage() {
-  printf "Usage: %s -t [template path] -n [template name] -s [snapshot name] -p [snapshot path] \n" $(basename $0) 
+  printf "Usage: %s -t [template path] -n [template name] -s [snapshot name] -p [snapshot path] \n" $(basename $0)
 }
 
 snapshotPath=
@@ -68,7 +68,7 @@
     exit 2
   fi
   if [[ "${parent}"  =~ " no parent" ]]; then
-    dd if=$srcvhd of=$desvhd bs=2M     
+    dd if=$srcvhd of=$desvhd bs=2M
     if [ $? -ne 0 ]; then
       echo "31#failed to dd $srcvhd to $desvhd"
       rm -rf $desvhd > /dev/null
diff --git a/scripts/storage/secondary/createtmplt.sh b/scripts/storage/secondary/createtmplt.sh
index 4bf90d6..ed9bbe8 100755
--- a/scripts/storage/secondary/createtmplt.sh
+++ b/scripts/storage/secondary/createtmplt.sh
@@ -6,16 +6,16 @@
 # 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
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
- 
+
 
 # $Id: createtmplt.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/secondary/createtmplt.sh $
 # createtmplt.sh -- install a template
@@ -41,7 +41,7 @@
 untar() {
   local ft=$(file $1| awk -F" " '{print $2}')
   case $ft in
-  USTAR) 
+  USTAR)
      printf "tar archives not supported\n"  >&2
      return 1
           ;;
@@ -87,12 +87,12 @@
 	;;
   esac
 
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to uncompress file (filetype=$ft), exiting "
-    return 1 
+    return 1
   fi
- 
+
   rm -f $1
   printf $tmpfile
 
@@ -167,7 +167,7 @@
 done
 
 isCifs() {
-   #TO:DO incase of multiple zone where cifs and nfs exists, 
+   #TO:DO incase of multiple zone where cifs and nfs exists,
    #then check if the template file is from cifs using df -P filename
    #Currently only cifs is supported in hyperv zone.
    mount | grep "type cifs" > /dev/null
@@ -182,7 +182,7 @@
 
 mkdir -p $tmpltfs
 
-if [ ! -f $tmpltimg ] 
+if [ ! -f $tmpltimg ]
 then
   printf "root disk file $tmpltimg doesn't exist\n"
   exit 3
diff --git a/scripts/storage/secondary/createvolume.sh b/scripts/storage/secondary/createvolume.sh
index e5838ae..ac69ebe 100755
--- a/scripts/storage/secondary/createvolume.sh
+++ b/scripts/storage/secondary/createvolume.sh
@@ -6,9 +6,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
@@ -16,7 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
- 
+
 
 # $Id: createvolume.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/secondary/createvolume.sh $
 # createvolume.sh -- install a volume
@@ -53,7 +53,7 @@
   esac
   echo  "$1  $2" | $digestalgo  -c --status
   #printf "$1\t$2" | $digestalgo  -c --status
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Checksum failed, not proceeding with install\n"
     exit 3
@@ -63,7 +63,7 @@
 untar() {
   local ft=$(file $1| awk -F" " '{print $2}')
   case $ft in
-  USTAR) 
+  USTAR)
      printf "tar archives not supported\n"  >&2
      return 1
           ;;
@@ -109,12 +109,12 @@
 	;;
   esac
 
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to uncompress file (filetype=$ft), exiting "
-    return 1 
+    return 1
   fi
- 
+
   rm -f $1
   printf $tmpfile
 
@@ -205,7 +205,7 @@
 
 mkdir -p $tmpltfs
 
-if [ ! -f $tmpltimg ] 
+if [ ! -f $tmpltimg ]
 then
   printf "root disk file $tmpltimg doesn't exist\n"
   exit 3
@@ -227,7 +227,7 @@
   if [ isCifs -ne 0 ] ;
   then
     if  which  vhd-util &>/dev/null
-    then 
+    then
       vhd-util check -n ${tmpltimg2} > /dev/null
       rollback_if_needed $tmpltfs $? "vhd check of $tmpltimg2 failed\n"
       vhd-util set -n ${tmpltimg2} -f "hidden" -v "0" > /dev/null
diff --git a/scripts/storage/secondary/installIso.sh b/scripts/storage/secondary/installIso.sh
index 44ca506..02b28c2 100755
--- a/scripts/storage/secondary/installIso.sh
+++ b/scripts/storage/secondary/installIso.sh
@@ -6,9 +6,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
@@ -29,7 +29,7 @@
 
 verify_cksum() {
   echo  "$1  $2" | md5sum  -c --status
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Checksum failed, not proceeding with install\n"
     exit 3
@@ -44,7 +44,7 @@
 
   mv $isofile /$isofs/$tmpltname
 
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Move operation failed, iso $isofile not installed\n"
     exit 4
@@ -55,7 +55,7 @@
   isofs=$isofs/$file
   mp=${isofs%/iso/*}
   mp=/$mp/iso
-  path=${isofs:${#mp}}  
+  path=${isofs:${#mp}}
   pushd $mp
   ln -s $path $file
   popd
@@ -108,10 +108,10 @@
   isofs=${isofs:1}
 fi
 
-if [ ! -d /$isofs ] 
+if [ ! -d /$isofs ]
 then
   mkdir -p /$isofs
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to create iso fs $isofs\n" >&2
     exit 1
diff --git a/scripts/storage/secondary/listvmtmplt.sh b/scripts/storage/secondary/listvmtmplt.sh
index 53fca48..8463b51 100755
--- a/scripts/storage/secondary/listvmtmplt.sh
+++ b/scripts/storage/secondary/listvmtmplt.sh
@@ -6,9 +6,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
@@ -50,7 +50,7 @@
 
 
 for i in $(find /$rootdir -name template.properties );
-do  
+do
   d=$(dirname $i)
   filename=$(grep "^filename" $i | awk -F"=" '{print $NF}')
 #  size=$(grep "virtualsize" $i | awk -F"=" '{print $NF}')
@@ -58,7 +58,7 @@
 #  then
 #    d=$d/$filename/$size
 #  fi
-  echo ${d#/}/$filename #remove leading slash 
+  echo ${d#/}/$filename #remove leading slash
 done
 
 exit 0
diff --git a/scripts/storage/secondary/listvolume.sh b/scripts/storage/secondary/listvolume.sh
index cdf2877..d039c65 100755
--- a/scripts/storage/secondary/listvolume.sh
+++ b/scripts/storage/secondary/listvolume.sh
@@ -6,9 +6,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
@@ -50,7 +50,7 @@
 
 
 for i in $(find /$rootdir -name volume.properties );
-do  
+do
   d=$(dirname $i)
   filename=$(grep "^filename" $i | awk -F"=" '{print $NF}')
 #  size=$(grep "virtualsize" $i | awk -F"=" '{print $NF}')
@@ -58,7 +58,7 @@
 #  then
 #    d=$d/$filename/$size
 #  fi
-  echo ${d#/}/$filename #remove leading slash 
+  echo ${d#/}/$filename #remove leading slash
 done
 
 exit 0
diff --git a/scripts/util/prepare_linmin.sh b/scripts/util/prepare_linmin.sh
index 7174167..5d3dc03 100755
--- a/scripts/util/prepare_linmin.sh
+++ b/scripts/util/prepare_linmin.sh
@@ -6,9 +6,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
diff --git a/scripts/vm/hypervisor/kvm/kvmheartbeat.sh b/scripts/vm/hypervisor/kvm/kvmheartbeat.sh
index 00e7846..9b7eada 100755
--- a/scripts/vm/hypervisor/kvm/kvmheartbeat.sh
+++ b/scripts/vm/hypervisor/kvm/kvmheartbeat.sh
@@ -6,9 +6,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
@@ -17,12 +17,12 @@
 # under the License.
 
 help() {
-  printf "Usage: $0 
-                    -i nfs server ip 
+  printf "Usage: $0
+                    -i nfs server ip
                     -p nfs server path
-                    -m mount point 
-                    -h host  
-                    -r write/read hb log 
+                    -m mount point
+                    -h host
+                    -r write/read hb log
                     -c cleanup
                     -t interval between read hb log\n"
   exit 1
@@ -52,7 +52,7 @@
      HostIP="$OPTARG"
      ;;
   r)
-     rflag=1 
+     rflag=1
      ;;
   t)
      interval="$OPTARG"
@@ -75,7 +75,7 @@
 #delete VMs on this mountpoint
 deleteVMs() {
   local mountPoint=$1
-  vmPids=$(ps aux| grep qemu | grep "$mountPoint" | awk '{print $2}' 2> /dev/null) 
+  vmPids=$(ps aux| grep qemu | grep "$mountPoint" | awk '{print $2}' 2> /dev/null)
   if [ $? -gt 0 ]
   then
      return
@@ -100,7 +100,7 @@
    mount $NfsSvrIP:$NfsSvrPath $MountPoint -o sync,soft,proto=tcp,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,noac &> /dev/null
    if [ $? -gt 0 ]
    then
-      printf "Failed to remount $NfsSvrIP:$NfsSvrPath under $MountPoint" 
+      printf "Failed to remount $NfsSvrIP:$NfsSvrPath under $MountPoint"
       exit 1
    fi
    if [ "$rflag" == "0" ]
@@ -162,6 +162,6 @@
   echo b > /proc/sysrq-trigger
   exit $?
 else
-  write_hbLog 
+  write_hbLog
   exit $?
 fi
diff --git a/scripts/vm/hypervisor/kvm/setup_agent.sh b/scripts/vm/hypervisor/kvm/setup_agent.sh
index 4ebd6d00..492e7ef 100755
--- a/scripts/vm/hypervisor/kvm/setup_agent.sh
+++ b/scripts/vm/hypervisor/kvm/setup_agent.sh
@@ -6,9 +6,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
@@ -17,7 +17,7 @@
 # under the License.
 
 
- 
+
 
 # Did cloudstack-agent installed
 #set -x
@@ -26,7 +26,7 @@
     local retry=10
     which cloudstack-setup-agent
     if [ $? -gt 0 ]
-    then 
+    then
         # download  the repo
         which wget
         if [ $? -gt 0 ]
@@ -36,7 +36,7 @@
             then
                 printf "failed to install wget"
                 exit 1
-            fi 
+            fi
         fi
         wget -N -P /etc/yum.repos.d/ http://download.cloudstack.org/foss/fedora/cloud.repo
         if [ $? -gt 0 ]
@@ -46,7 +46,7 @@
         fi
         if [ "$dev" == "1" ]
         then
-            sed -i 's/\(baseurl\)\(.*\)/\1=http:\/\/yumrepo.lab.vmops.com\/repositories\/fedora\/vmdev\/oss\//'	/etc/yum.repos.d/cloud.repo 
+            sed -i 's/\(baseurl\)\(.*\)/\1=http:\/\/yumrepo.lab.vmops.com\/repositories\/fedora\/vmdev\/oss\//'	/etc/yum.repos.d/cloud.repo
         fi
         while [ "$retry" -gt "0" ]
         do
@@ -74,7 +74,7 @@
 
         done
     fi
-    
+
     if [ $? -gt 0 ]
     then
         printf "Failed to install agent"
@@ -87,7 +87,7 @@
     local retry=10
     which cloud-setup-console-proxy
     if [ $? -gt 0 ]
-    then 
+    then
         # download  the repo
         which wget
         if [ $? -gt 0 ]
@@ -97,7 +97,7 @@
             then
                 printf "failed to install wget"
                 exit 1
-            fi 
+            fi
         fi
         wget -N -P=/etc/yum.repos.d/ http://download.cloudstack.org/foss/fedora/cloud.repo
         if [ $? -gt 0 ]
@@ -107,7 +107,7 @@
         fi
         if [ "$dev" == "1" ]
         then
-            sed -i 's/\(baseurl\)\(.*\)/\1=http:\/\/yumrepo.lab.vmops.com\/repositories\/fedora\/vmdev\/oss\//'	/etc/yum.repos.d/cloud.repo 
+            sed -i 's/\(baseurl\)\(.*\)/\1=http:\/\/yumrepo.lab.vmops.com\/repositories\/fedora\/vmdev\/oss\//'	/etc/yum.repos.d/cloud.repo
         fi
         while [ "$retry" -gt "0" ]
         do
@@ -135,7 +135,7 @@
 
         done
     fi
-    
+
     if [ $? -gt 0 ]
     then
         printf "Failed to install console"
@@ -176,28 +176,28 @@
 while getopts 'h:z:p:u:c:P:N:d' OPTION
 do
   case $OPTION in
-  h) 
+  h)
         host="$OPTARG"
         ;;
-  z)    
+  z)
         zone="$OPTARG"
         ;;
-  p)    
+  p)
         pod="$OPTARG"
         ;;
-  c)    
+  c)
         cluster="$OPTARG"
         ;;
-  u)    
+  u)
         guid="$OPTARG"
         ;;
-  d)    
+  d)
         dflag=1
         ;;
-  P)    
+  P)
 	pubNic="$OPTARG"
         ;;
-  N)    
+  N)
 	prvNic="$OPTARG"
 	;;
   *)    ;;
diff --git a/scripts/vm/hypervisor/xenserver/check_heartbeat.sh b/scripts/vm/hypervisor/xenserver/check_heartbeat.sh
index e1b1827..6f1a144 100755
--- a/scripts/vm/hypervisor/xenserver/check_heartbeat.sh
+++ b/scripts/vm/hypervisor/xenserver/check_heartbeat.sh
@@ -6,9 +6,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
@@ -17,7 +17,7 @@
 # under the License.
 
 #set -x
- 
+
 usage() {
   printf "Usage: %s [uuid of this host] [interval in seconds]\n" $(basename $0) >&2
 
@@ -53,7 +53,7 @@
   diff=`expr $date - $ping`
   if [ $diff -lt $2 ]; then
     echo "=====> ALIVE <====="
-    exit 0;    
+    exit 0;
   fi
 done
 
@@ -67,7 +67,7 @@
   diff=`expr $date - $ping`
   if [ $diff -lt $2 ]; then
     echo "=====> ALIVE <====="
-    exit 0;    
+    exit 0;
   fi
 done
 
diff --git a/scripts/vm/hypervisor/xenserver/cloud-clean-vlan.sh b/scripts/vm/hypervisor/xenserver/cloud-clean-vlan.sh
index 7fd4983..55da63e 100755
--- a/scripts/vm/hypervisor/xenserver/cloud-clean-vlan.sh
+++ b/scripts/vm/hypervisor/xenserver/cloud-clean-vlan.sh
@@ -6,9 +6,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
diff --git a/scripts/vm/hypervisor/xenserver/cloud-prepare-upgrade.sh b/scripts/vm/hypervisor/xenserver/cloud-prepare-upgrade.sh
index 3a1f88b..7061d23 100755
--- a/scripts/vm/hypervisor/xenserver/cloud-prepare-upgrade.sh
+++ b/scripts/vm/hypervisor/xenserver/cloud-prepare-upgrade.sh
@@ -6,9 +6,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
@@ -88,7 +88,7 @@
 
 vms=$(xe vm-list is-control-domain=false| grep ^uuid | awk '{print $NF}')
 for vm in $vms
-do  
+do
   state=$(xe vm-param-get uuid=$vm param-name=power-state)
   if [ $state = "running" ]; then
     fake_pv_driver $vm
diff --git a/scripts/vm/hypervisor/xenserver/cloud-propagate-vlan.sh b/scripts/vm/hypervisor/xenserver/cloud-propagate-vlan.sh
index 1e3674c..9d98f7d 100755
--- a/scripts/vm/hypervisor/xenserver/cloud-propagate-vlan.sh
+++ b/scripts/vm/hypervisor/xenserver/cloud-propagate-vlan.sh
@@ -6,9 +6,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
diff --git a/scripts/vm/hypervisor/xenserver/cloud-setup-bonding.sh b/scripts/vm/hypervisor/xenserver/cloud-setup-bonding.sh
index 699d1d3..c60ca2f 100755
--- a/scripts/vm/hypervisor/xenserver/cloud-setup-bonding.sh
+++ b/scripts/vm/hypervisor/xenserver/cloud-setup-bonding.sh
@@ -6,9 +6,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
@@ -17,7 +17,7 @@
 # under the License.
 
 #set -x
- 
+
 usage() {
   printf "Usage: %s \n" $(basename $0) >&2
 
@@ -33,7 +33,7 @@
       if [ -n "$bondSlaveIp" ]; then
         mode=$(xe pif-param-get param-name=IP-configuration-mode uuid=$bondSlave)
         netmask=$(xe pif-param-get param-name=netmask uuid=$bondSlave)
-        gateway=$(xe pif-param-get param-name=gateway uuid=$bondSlave)       
+        gateway=$(xe pif-param-get param-name=gateway uuid=$bondSlave)
         DNS=$(xe pif-param-get param-name=DNS uuid=$bondSlave)
         management=$(xe pif-param-get param-name=management uuid=$bondSlave)
         slavedevice=$(xe pif-param-get param-name=device uuid=$bondSlave)
@@ -47,7 +47,7 @@
         echo "  --Succeeded"
         if [ "$management" = "true" ]; then
           echo "  --move management interface from $slavedevice($bondSlave) to $masterdevice($bondMaster)"
-          xe host-management-reconfigure pif-uuid=$bondMaster 
+          xe host-management-reconfigure pif-uuid=$bondMaster
           if [ $? -ne 0 ]; then
             echo "  --Failed to move management interface from $bondSlave to $bondMaster, please run xe host-management-reconfigure pif-uuid=$bondMaster manually"
             exit 1
@@ -62,7 +62,7 @@
       xe pif-plug uuid=$bondMaster
     done
   fi
-} 
+}
 
 poolUuid=$(xe pool-list | grep ^uuid | awk '{print $NF}')
 hostMaster=$(xe pool-param-get uuid=$poolUuid param-name=master)
diff --git a/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh b/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh
index 6c78613..1e4961c 100755
--- a/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh
+++ b/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh
@@ -6,9 +6,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
@@ -17,14 +17,14 @@
 # under the License.
 
 #set -x
- 
+
 usage() {
-  printf "Usage: %s [vhd file in secondary storage] [uuid of the source sr] [name label]  \n" $(basename $0) 
+  printf "Usage: %s [vhd file in secondary storage] [uuid of the source sr] [name label]  \n" $(basename $0)
 }
 
 cleanup()
 {
-  if [ ! -z $localmp ]; then 
+  if [ ! -z $localmp ]; then
     umount -fl $localmp
     if [ $? -eq 0 ];  then
       rmdir $localmp
@@ -158,7 +158,7 @@
     exit 0
   fi
   copyvhd $desvhd $vhdfile $lvsize $type
-else 
+else
   echo "15#doesn't support sr type $type"
   cleanup
   exit 0
diff --git a/scripts/vm/hypervisor/xenserver/copy_vhd_to_secondarystorage.sh b/scripts/vm/hypervisor/xenserver/copy_vhd_to_secondarystorage.sh
index 36e8222..a5fd1c0 100755
--- a/scripts/vm/hypervisor/xenserver/copy_vhd_to_secondarystorage.sh
+++ b/scripts/vm/hypervisor/xenserver/copy_vhd_to_secondarystorage.sh
@@ -6,9 +6,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
@@ -17,14 +17,14 @@
 # under the License.
 
 #set -x
- 
+
 usage() {
-  printf "Usage: %s [mountpoint in secondary storage] [uuid of the source vdi] [uuid of the source sr]\n" $(basename $0) 
+  printf "Usage: %s [mountpoint in secondary storage] [uuid of the source vdi] [uuid of the source sr]\n" $(basename $0)
 }
 
 cleanup()
 {
-  if [ ! -z $localmp ]; then 
+  if [ ! -z $localmp ]; then
     umount $localmp
     if [ $? -eq 0 ];  then
       rmdir $localmp
@@ -120,7 +120,7 @@
     cleanup
     exit 0
   fi
-else 
+else
   echo "15#doesn't support sr type $type"
   cleanup
   exit 0
diff --git a/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh b/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh
index 447f5f8..e98a4a5 100755
--- a/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh
+++ b/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh
@@ -6,9 +6,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
@@ -17,20 +17,20 @@
 # under the License.
 
 #set -x
- 
+
 usage() {
-  printf "Usage: %s [vhd file in secondary storage] [template directory in secondary storage] [template local dir] \n" $(basename $0) 
+  printf "Usage: %s [vhd file in secondary storage] [template directory in secondary storage] [template local dir] \n" $(basename $0)
 }
 options='tcp,soft,timeo=133,retrans=1'
 cleanup()
 {
-  if [ ! -z $snapshotdir ]; then 
+  if [ ! -z $snapshotdir ]; then
     umount $snapshotdir
     if [ $? -eq 0 ];  then
       rmdir $snapshotdir
     fi
   fi
-  if [ ! -z $templatedir ]; then 
+  if [ ! -z $templatedir ]; then
     umount $templatedir
     if [ $? -eq 0 ];  then
       rmdir $templatedir
@@ -110,7 +110,7 @@
     exit 0
   fi
   if [[ "${parent}"  =~ " no parent" ]]; then
-    dd if=$srcvhd of=$desvhd bs=2M     
+    dd if=$srcvhd of=$desvhd bs=2M
     if [ $? -ne 0 ]; then
       echo "31#failed to dd $srcvhd to $desvhd"
       cleanup
diff --git a/scripts/vm/hypervisor/xenserver/kill_copy_process.sh b/scripts/vm/hypervisor/xenserver/kill_copy_process.sh
index 5ec267c..9190493 100755
--- a/scripts/vm/hypervisor/xenserver/kill_copy_process.sh
+++ b/scripts/vm/hypervisor/xenserver/kill_copy_process.sh
@@ -6,9 +6,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
@@ -17,9 +17,9 @@
 # under the License.
 
 #set -x
- 
+
 usage() {
-  printf "Usage: %s [name label]  \n" $(basename $0) 
+  printf "Usage: %s [name label]  \n" $(basename $0)
 }
 
 if [ -z $1 ]; then
@@ -34,7 +34,7 @@
 if [ -z $pid ]; then
   echo "true"
   exit 0
-fi 
+fi
 
 kill -9 $pid
 if [ $? -ne 0 ]; then
diff --git a/scripts/vm/hypervisor/xenserver/launch_hb.sh b/scripts/vm/hypervisor/xenserver/launch_hb.sh
index 0a12b7a..cf7a194 100755
--- a/scripts/vm/hypervisor/xenserver/launch_hb.sh
+++ b/scripts/vm/hypervisor/xenserver/launch_hb.sh
@@ -6,9 +6,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
@@ -17,7 +17,7 @@
 # under the License.
 
 #set -x
- 
+
 usage() {
   printf "Usage: %s [uuid of this host] [interval in seconds]\n" $(basename $0)
 
diff --git a/scripts/vm/hypervisor/xenserver/make_migratable.sh b/scripts/vm/hypervisor/xenserver/make_migratable.sh
index a7ae262..9511448 100755
--- a/scripts/vm/hypervisor/xenserver/make_migratable.sh
+++ b/scripts/vm/hypervisor/xenserver/make_migratable.sh
@@ -6,9 +6,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
@@ -23,7 +23,7 @@
   echo " -- fakes the presence of PV tools in <VM uuid>"
   echo " -- NB the VM must be either paused or running on localhost"
 }
- 
+
 fake(){
   local uuid=$1
   domid=$(xe vm-list uuid=${uuid} params=dom-id --minimal)
diff --git a/scripts/vm/hypervisor/xenserver/network_info.sh b/scripts/vm/hypervisor/xenserver/network_info.sh
index ff4805a..05e85c5 100755
--- a/scripts/vm/hypervisor/xenserver/network_info.sh
+++ b/scripts/vm/hypervisor/xenserver/network_info.sh
@@ -6,9 +6,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
diff --git a/scripts/vm/hypervisor/xenserver/ovs-get-bridge.sh b/scripts/vm/hypervisor/xenserver/ovs-get-bridge.sh
index f56ddf9..321822f 100755
--- a/scripts/vm/hypervisor/xenserver/ovs-get-bridge.sh
+++ b/scripts/vm/hypervisor/xenserver/ovs-get-bridge.sh
@@ -6,9 +6,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
diff --git a/scripts/vm/hypervisor/xenserver/ovs-get-dhcp-iface.sh b/scripts/vm/hypervisor/xenserver/ovs-get-dhcp-iface.sh
index 6b30ee6..c2d984e 100755
--- a/scripts/vm/hypervisor/xenserver/ovs-get-dhcp-iface.sh
+++ b/scripts/vm/hypervisor/xenserver/ovs-get-dhcp-iface.sh
@@ -6,9 +6,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
diff --git a/scripts/vm/hypervisor/xenserver/setup_heartbeat_file.sh b/scripts/vm/hypervisor/xenserver/setup_heartbeat_file.sh
index 125fc2b..5e4a448 100755
--- a/scripts/vm/hypervisor/xenserver/setup_heartbeat_file.sh
+++ b/scripts/vm/hypervisor/xenserver/setup_heartbeat_file.sh
@@ -6,9 +6,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
@@ -48,7 +48,7 @@
   exit 0
 fi
 
-if [ `xe sr-list uuid=$2 | wc -l`  -eq 0 ]; then 
+if [ `xe sr-list uuid=$2 | wc -l`  -eq 0 ]; then
   echo "#4# Unable to find SR with uuid: $2"
   exit 0
 fi
@@ -64,7 +64,7 @@
 
   srtype=`xe sr-param-get param-name=type uuid=$2`
 
- 
+
   if [ "$srtype" = "nfs" ];then
     dir=/var/run/sr-mount/$2
     filename=$dir/hb-$1
@@ -72,7 +72,7 @@
       echo "#6# heartbeat file $filename doesn't exist"
       exit 0
     fi
-  else 
+  else
     dir=/dev/VG_XenStorage-$2
     link=$dir/hb-$1
     lvchange -ay $link
@@ -93,9 +93,9 @@
     echo $dir >> $hbfile
   fi
 
-else 
+else
   if [ -f $hbfile ]; then
-    sed -i /$2/d $hbfile 
+    sed -i /$2/d $hbfile
   fi
 fi
 
diff --git a/scripts/vm/hypervisor/xenserver/setup_iscsi.sh b/scripts/vm/hypervisor/xenserver/setup_iscsi.sh
index 096e161..47376be 100755
--- a/scripts/vm/hypervisor/xenserver/setup_iscsi.sh
+++ b/scripts/vm/hypervisor/xenserver/setup_iscsi.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 # $Id: setup_iscsi.sh 9879 2010-06-24 02:41:46Z anthony $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/vm/hypervisor/xenserver/setup_iscsi.sh $
 
 #set -x
- 
+
 usage() {
   printf "Usage: %s [uuid of host script is running on]\n" $(basename $0) >&2
 }
diff --git a/scripts/vm/hypervisor/xenserver/setupxenserver.sh b/scripts/vm/hypervisor/xenserver/setupxenserver.sh
index ef1f68f..8f93f48 100755
--- a/scripts/vm/hypervisor/xenserver/setupxenserver.sh
+++ b/scripts/vm/hypervisor/xenserver/setupxenserver.sh
@@ -6,9 +6,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
@@ -17,7 +17,7 @@
 # under the License.
 
 #set -x
- 
+
 usage() {
   printf "Usage: \n" $(basename $0)
 
diff --git a/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh b/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh
index 3813fd7..7426e44 100755
--- a/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh
+++ b/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh
@@ -6,9 +6,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
@@ -17,20 +17,20 @@
 # under the License.
 
 #set -x
- 
+
 usage() {
-  printf "Usage: %s [vhd file in secondary storage] [template directory in secondary storage] \n" $(basename $0) 
+  printf "Usage: %s [vhd file in secondary storage] [template directory in secondary storage] \n" $(basename $0)
 }
 
 cleanup()
 {
-  if [ ! -z $snapshotdir ]; then 
+  if [ ! -z $snapshotdir ]; then
     umount $snapshotdir
     if [ $? -eq 0 ];  then
       rmdir $snapshotdir
     fi
   fi
-  if [ ! -z $templatedir ]; then 
+  if [ ! -z $templatedir ]; then
     umount $templatedir
     if [ $? -eq 0 ];  then
       rmdir $templatedir
@@ -99,7 +99,7 @@
     exit 0
   fi
   if [ "${parent##*vhd has}" = " no parent" ]; then
-    dd if=$templatevhd of=$snapshotdir/$templatefilename bs=2M 
+    dd if=$templatevhd of=$snapshotdir/$templatefilename bs=2M
     if [ $? -ne 0 ]; then
       echo "31#failed to dd $templatevhd to $snapshotdir/$templatefilenamed"
       cleanup
diff --git a/scripts/vm/hypervisor/xenserver/upgrade_vnc_config.sh b/scripts/vm/hypervisor/xenserver/upgrade_vnc_config.sh
index c6a1467..bd164e0 100755
--- a/scripts/vm/hypervisor/xenserver/upgrade_vnc_config.sh
+++ b/scripts/vm/hypervisor/xenserver/upgrade_vnc_config.sh
@@ -5,9 +5,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
diff --git a/scripts/vm/hypervisor/xenserver/xs_cleanup.sh b/scripts/vm/hypervisor/xenserver/xs_cleanup.sh
index d2efa86..951d543 100755
--- a/scripts/vm/hypervisor/xenserver/xs_cleanup.sh
+++ b/scripts/vm/hypervisor/xenserver/xs_cleanup.sh
@@ -6,9 +6,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
@@ -17,7 +17,7 @@
 # under the License.
 
 #set -x
- 
+
 usage() {
   printf "Usage: %s \n" $(basename $0) >&2
 
@@ -57,7 +57,7 @@
 for be in $bes
 do
   device=`xenstore-read /local/domain/0/backend/tap/0/$be/dev`
-  ls $device >/dev/null 2>&1 
+  ls $device >/dev/null 2>&1
   if [ $? -ne 0 ]; then
     remove_device $be
   fi
diff --git a/scripts/vm/network/ovs-pvlan-cleanup.sh b/scripts/vm/network/ovs-pvlan-cleanup.sh
index b79c2bd..b8ec6ab 100755
--- a/scripts/vm/network/ovs-pvlan-cleanup.sh
+++ b/scripts/vm/network/ovs-pvlan-cleanup.sh
@@ -6,9 +6,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
diff --git a/scripts/vm/network/ovs-pvlan-dhcp-host.sh b/scripts/vm/network/ovs-pvlan-dhcp-host.sh
index 64565ff..0904eec 100755
--- a/scripts/vm/network/ovs-pvlan-dhcp-host.sh
+++ b/scripts/vm/network/ovs-pvlan-dhcp-host.sh
@@ -6,9 +6,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
diff --git a/scripts/vm/network/ovs-pvlan-kvm-dhcp-host.sh b/scripts/vm/network/ovs-pvlan-kvm-dhcp-host.sh
index 46eceb9..22b759a 100755
--- a/scripts/vm/network/ovs-pvlan-kvm-dhcp-host.sh
+++ b/scripts/vm/network/ovs-pvlan-kvm-dhcp-host.sh
@@ -6,9 +6,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
diff --git a/scripts/vm/network/ovs-pvlan-vm.sh b/scripts/vm/network/ovs-pvlan-vm.sh
index c306faa..95054c8 100755
--- a/scripts/vm/network/ovs-pvlan-vm.sh
+++ b/scripts/vm/network/ovs-pvlan-vm.sh
@@ -6,9 +6,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
diff --git a/scripts/vm/network/vnet/modifyvlan.sh b/scripts/vm/network/vnet/modifyvlan.sh
index 30efc90..732021f 100755
--- a/scripts/vm/network/vnet/modifyvlan.sh
+++ b/scripts/vm/network/vnet/modifyvlan.sh
@@ -6,9 +6,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
@@ -36,10 +36,10 @@
 		ip link add link $pif name $vlanDev type vlan id $vlanId > /dev/null
 		echo 1 > /proc/sys/net/ipv6/conf/$vlanDev/disable_ipv6
 		ip link set $vlanDev up
-		
+
 		if [ $? -gt 0 ]
 		then
-            # race condition that someone already creates the vlan 
+            # race condition that someone already creates the vlan
 			if [ ! -d /sys/class/net/$vlanDev ]
             then
 			    printf "Failed to create vlan $vlanId on pif: $pif."
@@ -47,18 +47,18 @@
             fi
 		fi
 	fi
-	
+
 	# disable IPv6
 	echo 1 > /proc/sys/net/ipv6/conf/$vlanDev/disable_ipv6
 	# is up?
 	ip link set $vlanDev up > /dev/null 2>/dev/null
-	
+
 	if [ ! -d /sys/class/net/$vlanBr ]
 	then
 		ip link add name $vlanBr type bridge
 		echo 1 > /proc/sys/net/ipv6/conf/$vlanBr/disable_ipv6
 		ip link set $vlanBr up
-	
+
 		if [ $? -gt 0 ]
 		then
 			if [ ! -d /sys/class/net/$vlanBr ]
@@ -68,15 +68,15 @@
 			fi
 		fi
 	fi
-	
+
 	#pif is eslaved into vlanBr?
-	ls /sys/class/net/$vlanBr/brif/ |grep -w "$vlanDev" > /dev/null 
+	ls /sys/class/net/$vlanBr/brif/ |grep -w "$vlanDev" > /dev/null
 	if [ $? -gt 0 ]
 	then
 		ip link set $vlanDev master $vlanBr
 		if [ $? -gt 0 ]
 		then
-			ls /sys/class/net/$vlanBr/brif/ |grep -w "$vlanDev" > /dev/null 
+			ls /sys/class/net/$vlanBr/brif/ |grep -w "$vlanDev" > /dev/null
 			if [ $? -gt 0 ]
 			then
 				printf "Failed to add vlan: $vlanDev to $vlanBr"
@@ -102,7 +102,7 @@
   if [ $deleteBr == "true" ]
   then
 	  ip link delete $vlanDev type vlan > /dev/null
-	
+
   	if [ $? -gt 0 ]
 	  then
 		  printf "Failed to del vlan: $vlanId"
@@ -124,7 +124,7 @@
     fi
   fi
 	return 0
-	
+
 }
 
 op=
@@ -179,18 +179,18 @@
 then
 	# Add the vlan
 	addVlan $vlanId $pif $brName
-	
+
 	# If the add fails then return failure
 	if [ $? -gt 0 ]
 	then
 		exit 1
 	fi
-else 
+else
 	if [ "$op" == "delete" ]
 	then
 		# Delete the vlan
 		deleteVlan $vlanId $pif $brName $deleteBr
-	
+
 		# Always exit with success
 		exit 0
 	fi
diff --git a/scripts/vm/pingtest.sh b/scripts/vm/pingtest.sh
index eb8a63d..7eff5c0 100755
--- a/scripts/vm/pingtest.sh
+++ b/scripts/vm/pingtest.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 # $Id: pingtest.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/vm/pingtest.sh $
-# pingtest.sh -- ping 
+# pingtest.sh -- ping
 usage() {
   printf "Usage:\n %s -i <domR eth1 ip>  -p <private-ip-address> \n" $(basename $0) >&2
   printf " %s -h <computing-agent-host-ip>  \n" $(basename $0) >&2
diff --git a/scripts/vm/systemvm/injectkeys.sh b/scripts/vm/systemvm/injectkeys.sh
index 747fb07..c5cc44e 100755
--- a/scripts/vm/systemvm/injectkeys.sh
+++ b/scripts/vm/systemvm/injectkeys.sh
@@ -6,9 +6,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
diff --git a/setup/bindir/cloud-migrate-databases.in b/setup/bindir/cloud-migrate-databases.in
index d9a124f..ed1d009 100644
--- a/setup/bindir/cloud-migrate-databases.in
+++ b/setup/bindir/cloud-migrate-databases.in
@@ -7,9 +7,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
diff --git a/setup/bindir/cloud-set-guest-password-configdrive.in b/setup/bindir/cloud-set-guest-password-configdrive.in
index 663dbd1..1527b7e 100644
--- a/setup/bindir/cloud-set-guest-password-configdrive.in
+++ b/setup/bindir/cloud-set-guest-password-configdrive.in
@@ -12,9 +12,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
diff --git a/setup/bindir/cloud-setup-baremetal.in b/setup/bindir/cloud-setup-baremetal.in
index c77937b..107984c 100644
--- a/setup/bindir/cloud-setup-baremetal.in
+++ b/setup/bindir/cloud-setup-baremetal.in
@@ -6,9 +6,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
@@ -69,15 +69,15 @@
         except:
             raise  CloudRuntimeException(formatExceptionInfo())
 
-#        if not self.success: 
+#        if not self.success:
 #            raise  CloudRuntimeException(self.getStderr())
 
     def isSuccess(self):
         return self.success
-    
+
     def getStdout(self):
         return self.stdout.strip("\n")
-    
+
     def getLines(self):
         return self.stdout.split("\n")
 
@@ -88,13 +88,13 @@
 def initLoging(logFile=None):
     try:
         if logFile is None:
-            logging.basicConfig(level=logging.DEBUG) 
-        else: 
-            logging.basicConfig(filename=logFile, level=logging.DEBUG) 
+            logging.basicConfig(level=logging.DEBUG)
+        else:
+            logging.basicConfig(filename=logFile, level=logging.DEBUG)
     except:
-        logging.basicConfig(level=logging.DEBUG) 
+        logging.basicConfig(level=logging.DEBUG)
 
-def writeProgressBar(msg, result=None):    
+def writeProgressBar(msg, result=None):
     if msg is not None:
         output = "%-80s"%msg
     elif result is True:
@@ -103,7 +103,7 @@
         output = "[ \033[91m%-6s\033[0m ]\n"%"FAILED"
     sys.stdout.write(output)
     sys.stdout.flush()
-    
+
 def printError(msg):
     sys.stderr.write(msg)
     sys.stderr.write("\n")
@@ -123,7 +123,7 @@
     else:
         writeProgressBar(None, True)
         return True
-      
+
 def checkEnv():
    writeProgressBar("Checking is root")
    ret = bash("whoami")
@@ -133,7 +133,7 @@
        return False
    else:
        writeProgressBar(None, True)
-       
+
    pkgList = ['tftp-server', 'syslinux', 'xinetd', 'chkconfig', 'dhcp']
    for pkg in pkgList:
        if not checkRpm(pkg):
@@ -141,8 +141,8 @@
    return True
 
 def exitIfFail(ret):
-    if not ret: sys.exit(1) 
-    
+    if not ret: sys.exit(1)
+
 def bashWithResult(cmd):
     writeProgressBar("Executing '%s'"%cmd)
     ret = bash(cmd)
@@ -153,23 +153,23 @@
     else:
         writeProgressBar(None, True)
         return True
-    
-def configurePxeStuff(): 
+
+def configurePxeStuff():
     stuff = ['tftp', 'xinetd', 'dhcpd']
     cmds = ['chkconfig --level 345 %s on' % i for i in stuff]
     cmds.append('/etc/init.d/xinetd restart')
-    
+
     for cmd in cmds:
         if not bashWithResult(cmd): return False
-        
+
     chkIptable = bash('chkconfig --list iptables')
     if 'on' in chkIptable.getStdout():
         printMsg("Detected iptables is running, need to open tftp port 69")
         if not bashWithResult('iptables -I INPUT 1 -p udp --dport 69 -j ACCEPT'): return False
         if not bashWithResult('/etc/init.d/iptables save'): return False
-        
-    return True  
-    
+
+    return True
+
 def getTftpRootDir(tftpRootDirList):
     tftpRoot = bash("cat /etc/xinetd.d/tftp | grep server_args")
     if not tftpRoot.isSuccess():
@@ -187,16 +187,16 @@
 def preparePING(tftpRootDir):
     pingFiles = ['boot.msg', 'initrd.gz', 'kernel', 'pxelinux.0']
     pingDir = "/usr/share/PING"
-    
+
     for f in pingFiles:
         path = join(pingDir, f)
         if not exists(path):
             printError("Cannot find %s, please make sure PING-3.01 is installed"%path)
             return False
         if not bashWithResult("cp -f %s %s"%(path, tftpRootDir)): return False
-     
+
     if not bashWithResult("mkdir -p %s/pxelinux.cfg"%tftpRootDir): return False
-    
+
     return True
 
 def prepareSyslinux(tftpRootDir):
@@ -211,16 +211,16 @@
 
     return True
 
-            
-        
+
+
 if __name__ == "__main__":
     initLoging("/tmp/cloud-setup-baremetal.log")
     tftpRootDirList = []
-    
+
     exitIfFail(checkEnv())
     exitIfFail(configurePxeStuff())
     exitIfFail(getTftpRootDir(tftpRootDirList))
-    
+
     tftpRootDir = tftpRootDirList[0].strip()
     #exitIfFail(preparePING(tftpRootDir))
     exitIfFail(prepareSyslinux(tftpRootDir))
@@ -228,4 +228,3 @@
     printMsg("Setup BareMetal PXE server successfully")
     printMsg("TFTP root directory is: %s\n"%tftpRootDir)
     sys.exit(0)
-    
diff --git a/setup/bindir/cloud-setup-encryption.in b/setup/bindir/cloud-setup-encryption.in
index 880edee..773753f 100755
--- a/setup/bindir/cloud-setup-encryption.in
+++ b/setup/bindir/cloud-setup-encryption.in
@@ -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
@@ -71,12 +71,12 @@
         def backUpDbDotProperties():
             dbpPath = os.path.join(self.dbConfPath, 'db.properties')
             copyPath = os.path.join(self.dbConfPath, 'db.properties.origin')
-            
+
             if os.path.isfile(dbpPath):
                 shutil.copy2(dbpPath, copyPath)
-        
+
         backUpDbDotProperties()
-    
+
     def postRun(self):
         def cleanOrRecoverDbDotProperties():
             dbpPath = os.path.join(self.dbConfPath, 'db.properties')
@@ -85,22 +85,22 @@
                 if not self.success:
                     shutil.copy2(copyPath, dbpPath)
                 os.remove(copyPath)
-        
+
         cleanOrRecoverDbDotProperties()
-                
-        
+
+
     def info(self, msg, result=None):
         output = ""
         if msg is not None:
             output = "%-80s"%msg
-            
+
         if result is True:
             output += "[ \033[92m%-2s\033[0m ]\n"%"OK"
         elif result is False:
             output += "[ \033[91m%-6s\033[0m ]\n"%"FAILED"
         sys.stdout.write(output)
         sys.stdout.flush()
-    
+
     def debug(self, msg):
         msg = "DEBUG:%s"%msg
         sys.stdout.write(msg)
@@ -113,19 +113,19 @@
         else:
             self.dbDotProperties[key] = (value, self.dbDotPropertiesIndex)
             self.dbDotPropertiesIndex += 1
-    
+
     def getDbProperty(self, key):
         if key not in self.dbDotProperties:
             return None
         (value, index) = self.dbDotProperties[key]
         return value
-        
+
     def errorAndExit(self, msg):
         self.postRun()
         err = '''\n\nWe apologize for below error:
-***************************************************************      
+***************************************************************
 %s
-*************************************************************** 
+***************************************************************
 Please run:
 
     cloud-setup-encryption -h
@@ -147,7 +147,7 @@
                 line = line.strip()
                 if line.startswith("#"): key = line; value = ''; passed = True
                 if line == '' or line == '\n': key = self.magicString + str(emptyLine); value = ''; emptyLine += 1; passed = True
-                
+
                 try:
                     if not passed:
                         (key, value) = line.split('=', 1)
@@ -161,9 +161,9 @@
                     self.errorAndExit(err)
                 self.putDbProperty(key, value)
             self.info("Preparing %s"%dbpPath, True)
-        
-        prepareDBDotProperties()    
-    
+
+        prepareDBDotProperties()
+
     def finalize(self):
         def finalizeDbProperties():
             entries = []
@@ -176,62 +176,62 @@
                 else:
                     entries.insert(index, "%s=%s"%(key, value))
             file(os.path.join(self.dbConfPath, 'db.properties'), 'w').write('\n'.join(entries))
-        
+
         self.info("Finalizing setup ...", None)
         finalizeDbProperties()
         self.info(None, True)
         self.success = True # At here, we have done successfully and nothing more after this flag is set
-                        
+
     def processEncryptionStuff(self):
         def encrypt(value):
             cmd = ['java','-classpath','"' + self.encryptionJarPath + '"','com.cloud.utils.crypt.EncryptionCLI','-i','"' + value + '"', '-p', '"' + self.mgmtsecretkey + '"']
             return runCmd(cmd).strip('\n')
-        
+
         def saveMgmtServerSecretKey():
             if self.encryptiontype == 'file':
                 file(self.encryptionKeyFile, 'w').write(self.mgmtsecretkey)
-                
+
         def formatEncryptResult(value):
             return 'ENC(%s)'%value
-        
+
         def encryptDBSecretKey():
             self.putDbProperty('db.cloud.encrypt.secret', formatEncryptResult(encrypt(self.dbsecretkey)))
 
         def encryptDBPassword():
-            dbPassword = self.getDbProperty('db.cloud.password')       
+            dbPassword = self.getDbProperty('db.cloud.password')
             if dbPassword == '': return # Don't encrypt empty password
             if dbPassword == None: self.errorAndExit('Cannot find db.cloud.password in %s'%os.path.join(self.dbConfPath, 'db.properties'))
             self.putDbProperty('db.cloud.password', formatEncryptResult(encrypt(dbPassword)))
-            
+
             usagePassword = self.getDbProperty('db.usage.password')
             if usagePassword == '': return # Don't encrypt empty password
             if usagePassword == None: self.errorAndExit('Cannot find db.usage.password in %s'%os.path.join(self.dbConfPath, 'db.properties'))
             self.putDbProperty('db.usage.password', formatEncryptResult(encrypt(usagePassword)))
-        
+
         self.info("Processing encryption ...", None)
         self.putDbProperty("db.cloud.encryption.type", self.encryptiontype)
         saveMgmtServerSecretKey()
         encryptDBSecretKey()
         encryptDBPassword()
         self.info(None, True)
-        
+
     def parseOptions(self):
-        def parseOtherOptions():                     
+        def parseOtherOptions():
             self.encryptiontype = self.options.encryptiontype
             self.mgmtsecretkey = self.options.mgmtsecretkey
             self.dbsecretkey = self.options.dbsecretkey
             self.isDebug = self.options.debug
-            
-            
+
+
         def validateParameters():
             if self.encryptiontype != 'file' and self.encryptiontype != 'web':
                 self.errorAndExit('Wrong encryption type %s, --encrypt-type can only be "file" or "web'%self.encryptiontype)
-            
+
     #---------------------- option parsing and command line checks ------------------------
         usage = """%prog [-e ENCRYPTIONTYPE] [-m MGMTSECRETKEY] [-k DBSECRETKEY] [--debug]
-    
-    This command sets up the CloudStack Encryption.    
-    
+
+    This command sets up the CloudStack Encryption.
+
     """
         self.parser = OptionParser(usage=usage)
         self.parser.add_option("-v", "--debug", action="store_true", dest="debug", default=False,
@@ -246,17 +246,17 @@
         (self.options, self.args) = self.parser.parse_args()
         parseOtherOptions()
         validateParameters()
-    
+
     def run(self):
         try:
             self.preRun()
             self.parseOptions()
-            self.prepareDBFiles()            
+            self.prepareDBFiles()
             self.processEncryptionStuff()
             self.finalize()
         finally:
             self.postRun()
-        
+
         print('')
         print("CloudStack has successfully setup Encryption")
         print('')
@@ -264,4 +264,3 @@
 if __name__ == "__main__":
    o = DBDeployer()
    o.run()
-        
diff --git a/setup/db/221to222upgrade.sh b/setup/db/221to222upgrade.sh
index 5113c51..2ea8f1d 100644
--- a/setup/db/221to222upgrade.sh
+++ b/setup/db/221to222upgrade.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 # mysql phase 1
@@ -32,7 +32,7 @@
 echo Running upgrade for database: cloud from 2.2.1 to 2.2.2
 mysql -u root -C cloud < 221to222.sql
 if [ $? -gt 0 ]
-then 
+then
 exit 1
 fi
 echo Finished upgrade for database: cloud from 2.2.1 to 2.2.2
@@ -42,7 +42,7 @@
 echo Running upgrade for database: cloud_usage from 2.2.1 to 2.2.2
 mysql -u root -C cloud_usage < 221to222_usage.sql
 if [ $? -gt 0 ]
-then 
+then
 exit 1
 fi
 echo Finished upgrade for database: cloud_usage from 2.2.1 to 2.2.2
diff --git a/setup/db/deploy-db-clouddev.sh b/setup/db/deploy-db-clouddev.sh
index 4aa544b..2ec2a46 100644
--- a/setup/db/deploy-db-clouddev.sh
+++ b/setup/db/deploy-db-clouddev.sh
@@ -6,9 +6,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
diff --git a/setup/db/deploy-db-dev.sh b/setup/db/deploy-db-dev.sh
index 29ec4db..7896276 100755
--- a/setup/db/deploy-db-dev.sh
+++ b/setup/db/deploy-db-dev.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 # deploy-db.sh -- deploys the database configuration.
 # set -x
@@ -64,7 +64,7 @@
 handle_error() {
     mysqlout=$?
     if [ $mysqlout -eq 1 ]; then
-        printf "Please enter root password for MySQL.\n" 
+        printf "Please enter root password for MySQL.\n"
         mysql --user=root --password < $1
         if [ $? -ne 0 ]; then
             printf "Error: Cannot execute $1\n"
@@ -133,7 +133,7 @@
     exit 12
   fi
 fi
-  
+
 
 echo "Creating Indice and Foreign Keys"
 mysql --user=cloud --password=cloud cloud < create-index-fk.sql
diff --git a/setup/db/deploy-db-simulator.sh b/setup/db/deploy-db-simulator.sh
index 20e12d3..27fba2e 100644
--- a/setup/db/deploy-db-simulator.sh
+++ b/setup/db/deploy-db-simulator.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 # deploy-db.sh -- deploys the database configuration.
 # set -x
@@ -65,7 +65,7 @@
 handle_error() {
     mysqlout=$?
     if [ $mysqlout -eq 1 ]; then
-        printf "Please enter root password for MySQL.\n" 
+        printf "Please enter root password for MySQL.\n"
         mysql --user=root --password < $1
         if [ $? -ne 0 ]; then
             printf "Error: Cannot execute $1\n"
@@ -139,7 +139,7 @@
     exit 12
   fi
 fi
-  
+
 
 echo "Creating Indice and Foreign Keys"
 mysql --user=cloud --password=cloud cloud < create-index-fk.sql
diff --git a/systemvm/debian/opt/cloud/bin/vr_cfg.sh b/systemvm/debian/opt/cloud/bin/vr_cfg.sh
index 2395407..2f51311 100755
--- a/systemvm/debian/opt/cloud/bin/vr_cfg.sh
+++ b/systemvm/debian/opt/cloud/bin/vr_cfg.sh
@@ -74,7 +74,7 @@
 
     fi
 
-done 
+done
 
 # archive the configuration file
 mv $cfg /var/cache/cloud/processed/
diff --git a/systemvm/patch-sysvms.sh b/systemvm/patch-sysvms.sh
index 4f4a38f..e719543 100644
--- a/systemvm/patch-sysvms.sh
+++ b/systemvm/patch-sysvms.sh
@@ -84,7 +84,7 @@
             break
           fi
         fi
-      done	
+      done
       if [ $patchfailed == 1 ]; then
         return
       fi
diff --git a/test/bindirbak/cloud-run-test.in b/test/bindirbak/cloud-run-test.in
index c3ec810..f0b79ee 100755
--- a/test/bindirbak/cloud-run-test.in
+++ b/test/bindirbak/cloud-run-test.in
@@ -7,9 +7,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
diff --git a/test/scripts/bootstrap-regression.sh b/test/scripts/bootstrap-regression.sh
index ff219dd..a8576c1 100755
--- a/test/scripts/bootstrap-regression.sh
+++ b/test/scripts/bootstrap-regression.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 set -e
diff --git a/test/scripts/build-env.sh b/test/scripts/build-env.sh
index 299b6b6..4e45546 100755
--- a/test/scripts/build-env.sh
+++ b/test/scripts/build-env.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 PATHSEP=':'
 if [[ $OSTYPE == "cygwin" ]] ; then
diff --git a/test/scripts/certDeleteEC2.sh b/test/scripts/certDeleteEC2.sh
index ed4947a..5951035 100755
--- a/test/scripts/certDeleteEC2.sh
+++ b/test/scripts/certDeleteEC2.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 set -e
 DST='src/'
diff --git a/test/scripts/certSubmitEC2.sh b/test/scripts/certSubmitEC2.sh
index 7ac915a..452ba0b 100755
--- a/test/scripts/certSubmitEC2.sh
+++ b/test/scripts/certSubmitEC2.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 set -e
 DST='src/'
diff --git a/test/scripts/checkLog.sh b/test/scripts/checkLog.sh
index 82619ff..4f9f1fd 100755
--- a/test/scripts/checkLog.sh
+++ b/test/scripts/checkLog.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 #set -x
diff --git a/test/scripts/checkOutOfMemory.sh b/test/scripts/checkOutOfMemory.sh
index cb5b595..6b16040 100755
--- a/test/scripts/checkOutOfMemory.sh
+++ b/test/scripts/checkOutOfMemory.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 while true
diff --git a/test/scripts/cleanparallel.sh b/test/scripts/cleanparallel.sh
index 0ccb546..03dd722 100755
--- a/test/scripts/cleanparallel.sh
+++ b/test/scripts/cleanparallel.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 . /etc/rc.d/init.d/functions
diff --git a/test/scripts/deploy-and-run-regression.sh b/test/scripts/deploy-and-run-regression.sh
index 691a930..40d939d 100755
--- a/test/scripts/deploy-and-run-regression.sh
+++ b/test/scripts/deploy-and-run-regression.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 set -e
diff --git a/test/scripts/deploy.sh b/test/scripts/deploy.sh
index 6b58e88..9d51129 100755
--- a/test/scripts/deploy.sh
+++ b/test/scripts/deploy.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 . /etc/rc.d/init.d/functions
diff --git a/test/scripts/deploycluster.sh b/test/scripts/deploycluster.sh
index 7d7e168..dbd2c7b 100755
--- a/test/scripts/deploycluster.sh
+++ b/test/scripts/deploycluster.sh
@@ -6,9 +6,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
diff --git a/test/scripts/executeUserAPI.sh b/test/scripts/executeUserAPI.sh
index caf54b1..7bfd6f4 100755
--- a/test/scripts/executeUserAPI.sh
+++ b/test/scripts/executeUserAPI.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 PATHSEP=':'
 if [[ $OSTYPE == "cygwin" ]] ; then
diff --git a/test/scripts/invoke.sh b/test/scripts/invoke.sh
index 2d8405f..8b14d2a 100755
--- a/test/scripts/invoke.sh
+++ b/test/scripts/invoke.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 cd /root/test/scripts && ./cleanparallel.sh && ./deploy.sh -i -d -r
 if [ $? -ne 0 ]; then exit 2; fi;
diff --git a/test/scripts/regression.sh b/test/scripts/regression.sh
index 7a7c9e0..bae8c7e 100755
--- a/test/scripts/regression.sh
+++ b/test/scripts/regression.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 set -e
 DST='../src/'
diff --git a/test/scripts/run.sh b/test/scripts/run.sh
index de1dc22..bbaac7a 100755
--- a/test/scripts/run.sh
+++ b/test/scripts/run.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 PATHSEP=':'
 if [[ $OSTYPE == "cygwin" ]] ; then
diff --git a/test/scripts/script_lock_test/test.sh b/test/scripts/script_lock_test/test.sh
index f50b27b..c428206 100755
--- a/test/scripts/script_lock_test/test.sh
+++ b/test/scripts/script_lock_test/test.sh
@@ -6,9 +6,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
diff --git a/test/scripts/script_lock_test/test_task.sh b/test/scripts/script_lock_test/test_task.sh
index 21d722e..c7f51a2 100755
--- a/test/scripts/script_lock_test/test_task.sh
+++ b/test/scripts/script_lock_test/test_task.sh
@@ -6,9 +6,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
diff --git a/test/scripts/sign.sh b/test/scripts/sign.sh
index db807c4..4052bb7 100755
--- a/test/scripts/sign.sh
+++ b/test/scripts/sign.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 set -e
 DST='../src/'
diff --git a/test/scripts/signEC2.sh b/test/scripts/signEC2.sh
index 78ca108..a519f65 100755
--- a/test/scripts/signEC2.sh
+++ b/test/scripts/signEC2.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 set -e
 DST='../src/'
diff --git a/test/scripts/usage/allocated.sh b/test/scripts/usage/allocated.sh
index bb7fa1b..c8d1763 100755
--- a/test/scripts/usage/allocated.sh
+++ b/test/scripts/usage/allocated.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 #set -x
 iteration=$(mysql -h $1 --user=root --skip-column-names -U cloud_usage -e "select count(*) from account;")
diff --git a/test/scripts/usage/network.sh b/test/scripts/usage/network.sh
index 81d6afd..3523b1b 100755
--- a/test/scripts/usage/network.sh
+++ b/test/scripts/usage/network.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 #set -x
 iteration=$(mysql -h $1 --user=root --skip-column-names -U cloud_usage -e "select count(*) from user_statistics;")
diff --git a/test/scripts/usage/running.sh b/test/scripts/usage/running.sh
index bbb9f14..ba67744 100755
--- a/test/scripts/usage/running.sh
+++ b/test/scripts/usage/running.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 #set -x
 iteration=$(mysql -h $1 --user=root --skip-column-names -U cloud_usage -e "select count(*) from account;")
diff --git a/test/scripts/usage/volume_usage.sh b/test/scripts/usage/volume_usage.sh
index a3b21d6..77842d3 100755
--- a/test/scripts/usage/volume_usage.sh
+++ b/test/scripts/usage/volume_usage.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 #set -x
 #Check first ROOT volume
diff --git a/test/scripts/xen/corrupttemplate.sh b/test/scripts/xen/corrupttemplate.sh
index d26097f..7578249 100755
--- a/test/scripts/xen/corrupttemplate.sh
+++ b/test/scripts/xen/corrupttemplate.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 host=""
diff --git a/test/scripts/xen/createfaketemplate.sh b/test/scripts/xen/createfaketemplate.sh
index cc91122..4508a1a 100755
--- a/test/scripts/xen/createfaketemplate.sh
+++ b/test/scripts/xen/createfaketemplate.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 host=""
diff --git a/test/scripts/xen/killvm.sh b/test/scripts/xen/killvm.sh
index 5aa9b1e..8c3d5cb 100755
--- a/test/scripts/xen/killvm.sh
+++ b/test/scripts/xen/killvm.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 uuid=""
diff --git a/test/scripts/xen/listtemplate.sh b/test/scripts/xen/listtemplate.sh
index 4b76b4a..50f4026 100755
--- a/test/scripts/xen/listtemplate.sh
+++ b/test/scripts/xen/listtemplate.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 host=""
diff --git a/test/scripts/xen/listvdi.sh b/test/scripts/xen/listvdi.sh
index 9125b75..25f210e 100755
--- a/test/scripts/xen/listvdi.sh
+++ b/test/scripts/xen/listvdi.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 uuid=""
diff --git a/test/scripts/xen/listvm.sh b/test/scripts/xen/listvm.sh
index 0a4e8b2..45be42c 100755
--- a/test/scripts/xen/listvm.sh
+++ b/test/scripts/xen/listvm.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 uuid=""
diff --git a/test/scripts/xen/ms.sh b/test/scripts/xen/ms.sh
index d4a6cbc..2a1a148 100755
--- a/test/scripts/xen/ms.sh
+++ b/test/scripts/xen/ms.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 host=""
diff --git a/test/scripts/xen/removetemplate.sh b/test/scripts/xen/removetemplate.sh
index dd632cf..39c91d0 100755
--- a/test/scripts/xen/removetemplate.sh
+++ b/test/scripts/xen/removetemplate.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 host=""
@@ -37,7 +37,7 @@
   esac
 done
 
-if  [ $path != "" ] 
+if  [ $path != "" ]
 then
 	var=`ssh root@$host "cd $storage && rm -rf $path"`
 fi
diff --git a/test/scripts/xen/shutdown.sh b/test/scripts/xen/shutdown.sh
index c5621b1b..7f422fb 100755
--- a/test/scripts/xen/shutdown.sh
+++ b/test/scripts/xen/shutdown.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 uuid=""
diff --git a/test/scripts/xen/sleep.sh b/test/scripts/xen/sleep.sh
index 68bde07..e5400a6 100755
--- a/test/scripts/xen/sleep.sh
+++ b/test/scripts/xen/sleep.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 sleep=60
diff --git a/test/scripts/xen/ssh.sh b/test/scripts/xen/ssh.sh
index b918c74..42abec9 100755
--- a/test/scripts/xen/ssh.sh
+++ b/test/scripts/xen/ssh.sh
@@ -6,9 +6,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
@@ -18,7 +18,7 @@
 
 
 
- 
+
 
 
 PATHSEP=':'
diff --git a/tools/apidoc/build-apidoc.sh b/tools/apidoc/build-apidoc.sh
index 35551cd..035a560 100755
--- a/tools/apidoc/build-apidoc.sh
+++ b/tools/apidoc/build-apidoc.sh
@@ -6,16 +6,16 @@
 # 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
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
- 
+
 
 # cloud-build-api-doc.sh -- builds api documentation.
 #set -x
diff --git a/tools/build/build_asf.sh b/tools/build/build_asf.sh
index 780473b..a68a71c 100755
--- a/tools/build/build_asf.sh
+++ b/tools/build/build_asf.sh
@@ -6,9 +6,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
@@ -104,7 +104,7 @@
 perl -pi -e "s/-SNAPSHOT//" tools/docker/Dockerfile.marvin
 perl -pi -e "s/-SNAPSHOT//" tools/docker/Dockerfile.centos6
 
-case "$currentversion" in 
+case "$currentversion" in
   *-SNAPSHOT*)
     perl -pi -e 's/-SNAPSHOT//' debian/rules
     ;;
@@ -112,7 +112,7 @@
 
 # set debian changelog entry
 tmpfilenm=$$.tmp
-echo "cloudstack ($version) unstable; urgency=low" >>$tmpfilenm 
+echo "cloudstack ($version) unstable; urgency=low" >>$tmpfilenm
 echo >>$tmpfilenm
 echo "  * Update the version to $version" >>$tmpfilenm
 echo >>$tmpfilenm
diff --git a/tools/build/installer/debinstall_full.sh b/tools/build/installer/debinstall_full.sh
index a3bf1ae..b125bbf 100644
--- a/tools/build/installer/debinstall_full.sh
+++ b/tools/build/installer/debinstall_full.sh
@@ -39,13 +39,13 @@
 function doinstall() {
     aptitude install "$@" || return $?
 }
-    
+
 function doupdate() {
     service cloud-management stop
     apt-get --force-yes -y -u install "cloud-*"
     service cloud-management restart
 }
-    
+
 function doremove() {
     apt-get remove "$@" || return $?
 }
@@ -57,13 +57,13 @@
 cd `dirname "$0"`
 setuprepo
 
-installms="    M) Install the Management Server   
+installms="    M) Install the Management Server
 "
 installag="    A) Install the Agent
 "
 installus="    S) Install the Usage Monitor
 "
-installdb="    D) Install the database server     
+installdb="    D) Install the database server
 "
 quitoptio="    Q) Quit
 "
diff --git a/tools/build/installer/rpminstall_full.sh b/tools/build/installer/rpminstall_full.sh
index 9cc78a5..1a34a03 100755
--- a/tools/build/installer/rpminstall_full.sh
+++ b/tools/build/installer/rpminstall_full.sh
@@ -43,12 +43,12 @@
 function doinstall() {
     yum install "$@" || return $?
 }
-    
+
 function doupdate() {
     yum update --enablerepo='cloud-temp' 'cloud-*' || return $?
     rpm -Uvh --force cloud-scripts-*.rpm
 }
-    
+
 function doremove() {
     yum remove "$@" || return $?
 }
@@ -60,7 +60,7 @@
 cd `dirname "$0"`
 setuprepo
 
-installms="    M) Install the Management Server   
+installms="    M) Install the Management Server
 "
 installag="    A) Install the Agent
 "
@@ -68,7 +68,7 @@
 "
 installus="    S) Install the Usage Monitor
 "
-installdb="    D) Install the database server     
+installdb="    D) Install the database server
 "
 quitoptio="    Q) Quit
 "
@@ -139,7 +139,7 @@
 
     echo "Installing the MySQL server..." >&2
     if doinstall mysql-server ; then
-        /sbin/chkconfig --add mysqld 
+        /sbin/chkconfig --add mysqld
         /sbin/chkconfig --level 345 mysqld on
         if /sbin/service mysqld status > /dev/null 2>&1 ; then
             echo "Restarting the MySQL server..." >&2
diff --git a/tools/build/setnextversion.sh b/tools/build/setnextversion.sh
index 47f5e39..3be6e6b 100755
--- a/tools/build/setnextversion.sh
+++ b/tools/build/setnextversion.sh
@@ -6,9 +6,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
diff --git a/tools/devcloud4/README.md b/tools/devcloud4/README.md
index b164bb4..43e662b 100644
--- a/tools/devcloud4/README.md
+++ b/tools/devcloud4/README.md
@@ -35,10 +35,10 @@
 	```
 
 1. Download and Install [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
-   
-   On Windows7, the Xenserver VM crashed immediately after booting with a General Protection Fault. 
+
+   On Windows7, the Xenserver VM crashed immediately after booting with a General Protection Fault.
    Installing VirtualBox version 4.3.6r91406 (https://www.virtualbox.org/wiki/Download_Old_Builds_4_3) fixed the problem, but only downgrade if the latest version does not work for you.
- 
+
 1. Download and install [Vagrant](https://www.vagrantup.com/downloads.html)
 
 1. Ensure all Vagrant Plugins are installed:
@@ -51,9 +51,9 @@
 
 ### Configure virtualbox
 
-1. Open virtualbox and navigate to its preferences/settings window. 
+1. Open virtualbox and navigate to its preferences/settings window.
 
-1. Click onto the network tab and then onto the host only network tab. 
+1. Click onto the network tab and then onto the host only network tab.
 
 1. Configure your adapters as follows:
 
@@ -61,25 +61,25 @@
      - vboxnet0: VirtualBox Host-Only Ethernet Adapter
      - vboxnet1: VirtualBox Host-Only Ethernet Adapter 2
      - vboxnet2: VirtualBox Host-Only Ethernet Adapter 3
-    
+
     #### For Basic Networking you only need:
 
     ##### vboxnet0
     - IPv4 IP address of 192.168.22.1
     - Subnet of 255.255.255.0
     - DHCP server disabled
-    
+
     #### For Advanced Networking you will need:
-    
-    
-    
+
+
+
     ##### vboxnet1
     - IPv4 IP address of 192.168.23.1
     - Subnet of 255.255.255.0
     - DHCP server disabled
-    
-    
-    
+
+
+
     ##### vboxnet2
     - IPv4 IP address of 192.168.24.1
     - Subnet of 255.255.255.0
@@ -98,4 +98,3 @@
  - IP: 192.168.22.10
  - Username: root
  - Password: password
-    
diff --git a/tools/devcloud4/advanced/README.md b/tools/devcloud4/advanced/README.md
index 467e4bb..2408279 100644
--- a/tools/devcloud4/advanced/README.md
+++ b/tools/devcloud4/advanced/README.md
@@ -1,8 +1,8 @@
 ### Configure virtualbox
 
-1. Open virtualbox and navigate to its preferences/settings window. 
+1. Open virtualbox and navigate to its preferences/settings window.
 
-1. Click onto the network tab and then onto the host only network tab. 
+1. Click onto the network tab and then onto the host only network tab.
 
 1. Configure your adapters as follows:
 
@@ -10,18 +10,18 @@
     - IPv4 IP address of 192.168.22.1
     - Subnet of 255.255.255.0
     - DHCP server disabled
-    
+
     ##### vboxnet1
     - IPv4 IP address of 192.168.23.1
     - Subnet of 255.255.255.0
     - DHCP server disabled
-    
+
     ##### vboxnet2
     - IPv4 IP address of 192.168.24.1
     - Subnet of 255.255.255.0
     - DHCP server disabled
-    
-   
+
+
 ### Start the vagrant boxes
 
 ```bash
@@ -43,8 +43,8 @@
 	```
 
 	*** Note: ***
-	
-	Personally I prefer to use the 4.3 codebase rather than main. If you wish to do the same:	
+
+	Personally I prefer to use the 4.3 codebase rather than main. If you wish to do the same:
 
 	```
 	git reset --hard 0810029
@@ -64,7 +64,7 @@
 	cd /path/to/cloudstack/repo
 	mvn -P developer,systemvm clean install -DskipTests=true
 	```
-	
+
 1. Deploy Cloudstack Database:
 
 	```bash
@@ -89,5 +89,5 @@
 1. Deploy:
 
     ```
-    python -m marvin.deployDataCenter -i marvin.cfg 
+    python -m marvin.deployDataCenter -i marvin.cfg
     ```
diff --git a/tools/devcloud4/basic/README.md b/tools/devcloud4/basic/README.md
index e60c6ee..c0ec6d8 100644
--- a/tools/devcloud4/basic/README.md
+++ b/tools/devcloud4/basic/README.md
@@ -1,8 +1,8 @@
 ### Configure virtualbox
 
-1. Open virtualbox and navigate to its preferences/settings window. 
+1. Open virtualbox and navigate to its preferences/settings window.
 
-1. Click onto the network tab and then onto the host only network tab. 
+1. Click onto the network tab and then onto the host only network tab.
 
 1. Configure your adapters as follows:
 
@@ -10,7 +10,7 @@
     - IPv4 IP address of 192.168.22.1
     - Subnet of 255.255.255.0
     - DHCP server disabled
-    
+
 
 ### Start the vagrant boxes
 
@@ -33,8 +33,8 @@
 	```
 
 	*** Note: ***
-	
-	Personally I prefer to use the 4.3 codebase rather than main. If you wish to do the same:	
+
+	Personally I prefer to use the 4.3 codebase rather than main. If you wish to do the same:
 
 	```
 	git reset --hard 0810029
@@ -54,7 +54,7 @@
 	cd /path/to/cloudstack/repo
 	mvn -P developer,systemvm clean install -DskipTests=true
 	```
-	
+
 1. Deploy Cloudstack Database:
 
 	```bash
@@ -79,5 +79,5 @@
 1. Deploying:
 
     ```
-    python -m marvin.deployDataCenter -i marvin.cfg 
+    python -m marvin.deployDataCenter -i marvin.cfg
     ```
diff --git a/tools/devcloud4/common/binary-installation/attributes/database_server.rb b/tools/devcloud4/common/binary-installation/attributes/database_server.rb
index 35a388f..200dd12 100644
--- a/tools/devcloud4/common/binary-installation/attributes/database_server.rb
+++ b/tools/devcloud4/common/binary-installation/attributes/database_server.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/binary-installation/attributes/default.rb b/tools/devcloud4/common/binary-installation/attributes/default.rb
index 94662ce..7f836b5 100644
--- a/tools/devcloud4/common/binary-installation/attributes/default.rb
+++ b/tools/devcloud4/common/binary-installation/attributes/default.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/binary-installation/metadata.rb b/tools/devcloud4/common/binary-installation/metadata.rb
index bc2f515..6180d50 100644
--- a/tools/devcloud4/common/binary-installation/metadata.rb
+++ b/tools/devcloud4/common/binary-installation/metadata.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/binary-installation/recipes/database_server.rb b/tools/devcloud4/common/binary-installation/recipes/database_server.rb
index b9341a2..0d0c223 100644
--- a/tools/devcloud4/common/binary-installation/recipes/database_server.rb
+++ b/tools/devcloud4/common/binary-installation/recipes/database_server.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/binary-installation/recipes/default.rb b/tools/devcloud4/common/binary-installation/recipes/default.rb
index 600ec98..d864056 100644
--- a/tools/devcloud4/common/binary-installation/recipes/default.rb
+++ b/tools/devcloud4/common/binary-installation/recipes/default.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/binary-installation/recipes/management_server.rb b/tools/devcloud4/common/binary-installation/recipes/management_server.rb
index 742f35f..06a0bae 100644
--- a/tools/devcloud4/common/binary-installation/recipes/management_server.rb
+++ b/tools/devcloud4/common/binary-installation/recipes/management_server.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/binary-installation/recipes/nfsshares.rb b/tools/devcloud4/common/binary-installation/recipes/nfsshares.rb
index 100eab9..bc12edc 100644
--- a/tools/devcloud4/common/binary-installation/recipes/nfsshares.rb
+++ b/tools/devcloud4/common/binary-installation/recipes/nfsshares.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/configure-network.sh b/tools/devcloud4/common/configure-network.sh
index dde115d..bcab660 100644
--- a/tools/devcloud4/common/configure-network.sh
+++ b/tools/devcloud4/common/configure-network.sh
@@ -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
diff --git a/tools/devcloud4/common/development-installation/attributes/database_server.rb b/tools/devcloud4/common/development-installation/attributes/database_server.rb
index 314f9c1..8a624e9 100644
--- a/tools/devcloud4/common/development-installation/attributes/database_server.rb
+++ b/tools/devcloud4/common/development-installation/attributes/database_server.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/development-installation/attributes/default.rb b/tools/devcloud4/common/development-installation/attributes/default.rb
index f2c5712..922bd9f 100644
--- a/tools/devcloud4/common/development-installation/attributes/default.rb
+++ b/tools/devcloud4/common/development-installation/attributes/default.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/development-installation/files/default/createtmplt.sh b/tools/devcloud4/common/development-installation/files/default/createtmplt.sh
index 6b31232..2f8f342 100755
--- a/tools/devcloud4/common/development-installation/files/default/createtmplt.sh
+++ b/tools/devcloud4/common/development-installation/files/default/createtmplt.sh
@@ -6,9 +6,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
@@ -16,7 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
- 
+
 
 # $Id: createtmplt.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/secondary/createtmplt.sh $
 # createtmplt.sh -- install a template
@@ -43,7 +43,7 @@
 verify_cksum() {
   echo  "$1  $2" | md5sum  -c --status
   #printf "$1\t$2" | md5sum  -c --status
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Checksum failed, not proceeding with install\n"
     exit 3
@@ -53,7 +53,7 @@
 untar() {
   local ft=$(file $1| awk -F" " '{print $2}')
   case $ft in
-  USTAR) 
+  USTAR)
      printf "tar archives not supported\n"  >&2
      return 1
           ;;
@@ -99,12 +99,12 @@
 	;;
   esac
 
-  if [ $? -gt 0 ] 
+  if [ $? -gt 0 ]
   then
     printf "Failed to uncompress file (filetype=$ft), exiting "
-    return 1 
+    return 1
   fi
- 
+
   rm -f $1
   printf $tmpfile
 
@@ -170,7 +170,7 @@
 done
 
 isCifs() {
-   #TO:DO incase of multiple zone where cifs and nfs exists, 
+   #TO:DO incase of multiple zone where cifs and nfs exists,
    #then check if the template file is from cifs using df -P filename
    #Currently only cifs is supported in hyperv zone.
    mount | grep "type cifs" > /dev/null
@@ -185,7 +185,7 @@
 
 mkdir -p $tmpltfs
 
-if [ ! -f $tmpltimg ] 
+if [ ! -f $tmpltimg ]
 then
   printf "root disk file $tmpltimg doesn't exist\n"
   exit 3
diff --git a/tools/devcloud4/common/development-installation/metadata.rb b/tools/devcloud4/common/development-installation/metadata.rb
index c240755..19255dd 100644
--- a/tools/devcloud4/common/development-installation/metadata.rb
+++ b/tools/devcloud4/common/development-installation/metadata.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/development-installation/recipes/database_server.rb b/tools/devcloud4/common/development-installation/recipes/database_server.rb
index b9341a2..0d0c223 100644
--- a/tools/devcloud4/common/development-installation/recipes/database_server.rb
+++ b/tools/devcloud4/common/development-installation/recipes/database_server.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/development-installation/recipes/default.rb b/tools/devcloud4/common/development-installation/recipes/default.rb
index 188d923..040e0cb 100644
--- a/tools/devcloud4/common/development-installation/recipes/default.rb
+++ b/tools/devcloud4/common/development-installation/recipes/default.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/development-installation/recipes/nfsshares.rb b/tools/devcloud4/common/development-installation/recipes/nfsshares.rb
index 100eab9..bc12edc 100644
--- a/tools/devcloud4/common/development-installation/recipes/nfsshares.rb
+++ b/tools/devcloud4/common/development-installation/recipes/nfsshares.rb
@@ -6,9 +6,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
diff --git a/tools/devcloud4/common/development-installation/recipes/system_templates.rb b/tools/devcloud4/common/development-installation/recipes/system_templates.rb
index 9601e7b..39f584c 100644
--- a/tools/devcloud4/common/development-installation/recipes/system_templates.rb
+++ b/tools/devcloud4/common/development-installation/recipes/system_templates.rb
@@ -6,9 +6,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
diff --git a/tools/docker/README.md b/tools/docker/README.md
index 4384342..84cb65b 100644
--- a/tools/docker/README.md
+++ b/tools/docker/README.md
@@ -19,7 +19,7 @@
 
 docker run --name simulator -p 8080:5050 -d apache/cloudstack-simulator
 
-or 
+or
 
 docker run --name simulator -p 8080:5050 -d apache/cloudstack-simulator:4.17.2.0
 
@@ -48,7 +48,7 @@
 docker exec -it simulator bash
 ```
 
-### CloudStack Management-server 
+### CloudStack Management-server
 
 ```
 docker pull mysql:5.5
diff --git a/tools/docker/systemtpl.sh b/tools/docker/systemtpl.sh
index 5298799..6d8a2d5 100755
--- a/tools/docker/systemtpl.sh
+++ b/tools/docker/systemtpl.sh
@@ -6,9 +6,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
diff --git a/tools/eclipse/set-eclipse-profile.sh b/tools/eclipse/set-eclipse-profile.sh
index 70dc8d4..48faba8 100644
--- a/tools/eclipse/set-eclipse-profile.sh
+++ b/tools/eclipse/set-eclipse-profile.sh
@@ -1,26 +1,26 @@
-#!/bin/bash                                                                                                                                                                         
-# Licensed to the Apache Software Foundation (ASF) under one                                                                                                                        
-# or more contributor license agreements.  See the NOTICE file                                                                                                                      
-# distributed with this work for additional information                                                                                                                             
-# regarding copyright ownership.  The ASF licenses this file                                                                                                                        
-# 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                                                                                                                            
-# KIND, either express or implied.  See the License for the                                                                                                                         
-# specific language governing permissions and limitations                                                                                                                           
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# 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
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
 # under the License.
 
-for file in `find . -name org.eclipse.m2e.core.prefs | xargs`; do 
-  if grep -q activeProfiles=eclipse $file; then 
-    echo Skipping $file; 
-  else 
-	echo Replacing $file; 
+for file in `find . -name org.eclipse.m2e.core.prefs | xargs`; do
+  if grep -q activeProfiles=eclipse $file; then
+    echo Skipping $file;
+  else
+	echo Replacing $file;
     sed -i -e s/activeProfiles=/activeProfiles=eclipse/g $file;
-  fi; 
+  fi;
 done
diff --git a/tools/marvin/MANIFEST.in b/tools/marvin/MANIFEST.in
index 3d37381..5f17a53 100644
--- a/tools/marvin/MANIFEST.in
+++ b/tools/marvin/MANIFEST.in
@@ -5,9 +5,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
diff --git a/tools/marvin/marvin/misc/build/CI.md b/tools/marvin/marvin/misc/build/CI.md
index d986850..89df14b 100644
--- a/tools/marvin/marvin/misc/build/CI.md
+++ b/tools/marvin/marvin/misc/build/CI.md
@@ -28,7 +28,7 @@
     .. hypervisor kickstarts
     .. adding new profiles
 . puppet
-. dnsmasq 
+. dnsmasq
 . ntpd
 . jenkins jnlp slave
 . scheduling
@@ -72,7 +72,7 @@
 
 When a new image needs to be added we create a 'distro' in cobbler and associate that with a profile's kickstart. Any new systems to be hooked-up to be serviced by the profile can then be added easily by cmd line.
 
-b. Puppet master - Cobbler reimages machines on-demand but it is upto puppet recipes to do configuration management within them. The configuration management is required for kvm hypervisors (kvm agent for eg:) and for the cloudstack management server which needs mysql, cloudstack, etc. The puppetmasterd daemon on the driver-vm is responsible for 'kicking' nodes to initiate configuration management on themselves when they come alive. 
+b. Puppet master - Cobbler reimages machines on-demand but it is upto puppet recipes to do configuration management within them. The configuration management is required for kvm hypervisors (kvm agent for eg:) and for the cloudstack management server which needs mysql, cloudstack, etc. The puppetmasterd daemon on the driver-vm is responsible for 'kicking' nodes to initiate configuration management on themselves when they come alive.
 
 So the driver-vm is also the repository of all the puppet recipes for various modules that need to be configured for the test infrastructure to work. The modules are placed in /etc/puppet and bear the same structure as our GitHub repo. When we need to affect a configuration change on any of our systems we only change the GitHub repo and the systems in place are affected upon next run.
 
@@ -90,7 +90,7 @@
 
 2. NFS storage - the nfs server is a single server serving as both primary and secondary storage. This is likely a limitation when compared to true production deployments but serves in good stead for a test setup. Where it becomes a limitation is in testing different storage backends. Object stores, local storage, clustered local storage etc are not addressed by this setup.
 
-3. Hypervisor hosts - There currently are 4 hosts in this environment. These are arranged at the moment in three pods so as to be capable of being deployed in a two zone environment. One zone with two pods and a second zone with a single pod. This covers tests that depend on 
+3. Hypervisor hosts - There currently are 4 hosts in this environment. These are arranged at the moment in three pods so as to be capable of being deployed in a two zone environment. One zone with two pods and a second zone with a single pod. This covers tests that depend on
 a. single zone/pod/cluster
 b. multiple cluster
 c. inter-zone tests
@@ -107,7 +107,7 @@
 control via github
 ==================
 
-there are two GitHub repositories controlling the test infrastructure. 
+there are two GitHub repositories controlling the test infrastructure.
 a. The puppet recipes at gh:acs-infra-test
 b. The gh:cloud-autodeploy repo that has the scripts to orchestrate the overall workflow
 
@@ -127,7 +127,7 @@
 5. based on the hypervisor chosen we choose a profile for cobbler to reimage the hosts in the infrastructure. if xen is chosen we bring up the profile of the latest xen kickstart available in cobbler. currently - this is at xen 6.0.2. if kvm is chosen we can pick between ubuntu and rhel based host OS  kickstarts.
 
 6. with this knowledge we kick off the driver script with the following cmd line arguments
-    $ python configure.py -v $hypervisor -d $distro -p $profile -l $LOG_LVL 
+    $ python configure.py -v $hypervisor -d $distro -p $profile -l $LOG_LVL
 
 The $distro argument chooses the hostOS of the mgmt server - this can be ubuntu / rhel. LOG_LVL can be set to INFO/DEBUG/WARN for troubleshooting and more verbose log output.
 
@@ -137,7 +137,7 @@
     c. starts up a new xenserver VM that will act as the mgmt server. we chose to keep things simple by launching the vm on a xenserver. one could employ jclouds via jenkins to deploy the mgmt server VM on a dogfooded cloudstack.
     d. in parallel the deployment config of marvin is parsed through to find the hypervisors that need to be cleaned up, pxe booted and prepared for the cloudstack deployment.
     e. all the hosts in the marvin config are pxe booted via ipmi and cobbler takes over to reimage them with the profile chosen by the jenkins job run.
-    f. while this is happening we also seed the secondary storage with the systemvm template reqd for the hypervisor. 
+    f. while this is happening we also seed the secondary storage with the systemvm template reqd for the hypervisor.
     g. all the primary stores in the marvin config are then cleaned for the next run.
 
 8. While cobbler is reimaging the hosts with the right profiles, the configure script waits until all hosts are reachable over ssh. It also checks for essential services (http, mysql) ports to come up. Cobbler once done with refreshing the machine hands over the reins to puppet.
diff --git a/tools/marvin/marvin/misc/build/README.md b/tools/marvin/marvin/misc/build/README.md
index 90598ed..400d21d 100644
--- a/tools/marvin/marvin/misc/build/README.md
+++ b/tools/marvin/marvin/misc/build/README.md
@@ -48,7 +48,7 @@
 ### 1a. reset the environment with the new build
 `$ python configure.py -b build.cfg -e environment.cfg -d deployment.cfg [[--skip-host] --install-marvin]`
 
-OR 
+OR
 
 ### b. reset the environment with specific build number
 `$ python configure.py -n <build-number> -e environment.cfg -d deployment.cfg [[--skip-host] --install-marvin]`
diff --git a/tools/marvin/marvin/misc/build/redeploy.sh b/tools/marvin/marvin/misc/build/redeploy.sh
index 29ddb7b..854d9d9 100755
--- a/tools/marvin/marvin/misc/build/redeploy.sh
+++ b/tools/marvin/marvin/misc/build/redeploy.sh
@@ -25,7 +25,7 @@
 
   printf "\nThe -s flag will clean the secondary path and install the specified
 hypervisor's system template as per -h, if -h is not given then xenserver is
-assumed\n"	
+assumed\n"
 
 }
 
@@ -66,7 +66,7 @@
 done
 
 if [[ -e /etc/redhat-release ]]
-then 
+then
 	cat /etc/redhat-release
 else
 	echo "script works on rpm environments only"
@@ -88,7 +88,7 @@
 fi
 
 #TODO: archive old logs
-#refresh log state 
+#refresh log state
 cat /dev/null > /var/log/cloud/management/management-server.log
 cat /dev/null > /var/log/cloud/management/api-server.log
 cat /dev/null > /var/log/cloud/management/catalina.out
diff --git a/tools/marvin/marvin/sandbox/run-marvin.sh b/tools/marvin/marvin/sandbox/run-marvin.sh
index 015a43b..1d1dcff 100755
--- a/tools/marvin/marvin/sandbox/run-marvin.sh
+++ b/tools/marvin/marvin/sandbox/run-marvin.sh
@@ -6,9 +6,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
diff --git a/tools/transifex/sync-transifex-ui.sh b/tools/transifex/sync-transifex-ui.sh
index 13d6ed6..f8c7d98 100755
--- a/tools/transifex/sync-transifex-ui.sh
+++ b/tools/transifex/sync-transifex-ui.sh
@@ -51,7 +51,7 @@
                         grep -v "^\s*//" ${DIRECTORY_RESOURCES}/${CODELANG}.js | sed -e 's/var dictionary = //' -e "\$s/;$//" > ${WORKDIR}/${CODELANG}.json
                         tx set -r ${ARGUMENTS} -l ${CODELANG} ${WORKDIR}/${CODELANG}.json
                         tx push -t -r ${ARGUMENTS} -l ${CODELANG}
-                else   
+                else
                         echo "Warning: the resource file for language ${CODELANG} doesn't exist."
                 fi
         done
@@ -64,7 +64,7 @@
                 if [ -f "${DIRECTORY_RESOURCES}/${CODELANG}.js" ]; then
                         grep -v "^\s*//" ${DIRECTORY_RESOURCES}/${CODELANG}.js | sed -e 's/var dictionary = //' -e "\$s/;$//" > ${WORKDIR}/${CODELANG}.json
                         tx set -r ${ARGUMENTS} -l ${CODELANG} ${WORKDIR}/${CODELANG}.json
-                else   
+                else
                         echo "\nWarning: the resource file for language ${CODELANG} doesn't exist."
                         echo "Run this command to force get this language from transifex:"
                         echo "\ntx set -r ${ARGUMENTS} -l ${CODELANG} ${WORKDIR}/${CODELANG}.json\n"
@@ -83,7 +83,7 @@
                                 -e '$s/\}$/\n\};/' \
                                 -e "1s~^~${AL2_STRING}~" \
                                 ${WORKDIR}/${CODELANG}.json > ${DIRECTORY_RESOURCES}/${CODELANG}.js
-                else   
+                else
                         echo "Warning: the resource file for language ${CODELANG} doesn't exist on transifex"
                 fi
         done
@@ -95,7 +95,7 @@
         if [ -f ${DIRECTORY_RESOURCES}/${SRCLANG}.js ]; then
                 grep -v "^\s*//" ${DIRECTORY_RESOURCES}/${SRCLANG}.js | sed -e 's/var dictionary = //' -e "\$s/;$//" > ${WORKDIR}/${SRCLANG}.json
                 tx set --source -r ${ARGUMENTS} -l ${SRCLANG} ${WORKDIR}/${SRCLANG}.json
-                tx push -s -r ${ARGUMENTS} 
+                tx push -s -r ${ARGUMENTS}
         else
                 echo "Warning: the source language doesn't exist!"
         fi
@@ -104,7 +104,7 @@
 doDownloadSourceLang()
 {
         # get all resource files from transifex
-        tx pull -s -r ${ARGUMENTS} 
+        tx pull -s -r ${ARGUMENTS}
         # Source language
         if [ -f "${WORKDIR}/${SRCLANG}.json" ]; then
                 sed -e 's/":"/": "/' \
diff --git a/tools/utils/database_comparision_during_upgrade/cloud_schema_comparision.sh b/tools/utils/database_comparision_during_upgrade/cloud_schema_comparision.sh
index 034b8da..135e1e2 100644
--- a/tools/utils/database_comparision_during_upgrade/cloud_schema_comparision.sh
+++ b/tools/utils/database_comparision_during_upgrade/cloud_schema_comparision.sh
@@ -52,20 +52,20 @@
                 cat $path1/upgradedschema >> $tablename.diff
                 sort $tablename.diff > $tablename.sort
                 uniq -u $tablename.sort > $tablename.uniq
-		
+
                 if [ -s $tablename.uniq ]
                 then
-                        echo $tablename  "table schema is different."                        
+                        echo $tablename  "table schema is different."
                         cat $path1/upgradedschema > $tablename
-                        rm -rf $tablename.diff $tablename.sort  
+                        rm -rf $tablename.diff $tablename.sort
 
                         # do something as file has data
                 else
 
-                        rm -rf $tablename.diff $tablename.sort $tablename.uniq 
+                        rm -rf $tablename.diff $tablename.sort $tablename.uniq
                 fi
 
-		
+
         fi
 done
 
diff --git a/tools/utils/database_comparision_during_upgrade/test_config_between_fresh_and_upgraded_setup.sh b/tools/utils/database_comparision_during_upgrade/test_config_between_fresh_and_upgraded_setup.sh
index d7fe251..3394a24 100644
--- a/tools/utils/database_comparision_during_upgrade/test_config_between_fresh_and_upgraded_setup.sh
+++ b/tools/utils/database_comparision_during_upgrade/test_config_between_fresh_and_upgraded_setup.sh
@@ -34,7 +34,7 @@
 mysql -u $dbuser -p$dbpwd -h $dbhost --skip-column-names  -e "select  name, scope  from cloud.configuration" > $path2/scope_configuration_upgrade
 
 
-IFS=$'\n' 
+IFS=$'\n'
 
 
 #to find difference between upgraded configuration and fresh install configuration
@@ -58,16 +58,16 @@
 		if [ ! -s t ]
                 then
                         echo $row >> ./only_in_upgraded
-                else		
+                else
 			fname=`awk '{print $1}' t`
 	                fvalue=`awk '{print $2}' t`
                 	fdefault=`awk '{print $3}' t`
 			#echo $fname $fvalue $fdefault
-			if [ $default !=  $value  ] 
+			if [ $default !=  $value  ]
 			then
 				if [ $default == $fdefault ] && [ $value == $fvalue ]
 				then
-					echo 	
+					echo
 				else
 					first="$name	$value"
 					second="$fname    $fvalue"
@@ -78,7 +78,7 @@
 				fi
 			fi
 		fi
-		
+
 	fi
 done
 
@@ -103,7 +103,7 @@
 			grep '^'$word'[^\.]\w*' $path2/configuration_upgrade >> ./final_diff4
 		        count1=`wc -l <./final_diff4`
 			count1=`expr $count1 - 1`
-				
+
 			if [ $count == $count1 ]
 			then
 				echo $row >> ./only_in_fresh