Fix spacing everywhere ;-(

Signed-off-by: Martin J. Bligh <[email protected]>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@605 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/hosts/base_classes.py b/server/hosts/base_classes.py
index 4564fc1..5ee7572 100644
--- a/server/hosts/base_classes.py
+++ b/server/hosts/base_classes.py
@@ -2,7 +2,8 @@
 #
 # Copyright 2007 Google Inc. Released under the GPL v2
 
-"""This module defines the base classes for the Host hierarchy.
+"""
+This module defines the base classes for the Host hierarchy.
 
 Implementation details:
 You should import the "hosts" package instead of importing each type of host.
@@ -12,9 +13,11 @@
 	CmdResult: contain the results of a Host.run() command execution
 """
 
-__author__ = """[email protected] (Martin J. Bligh),
+__author__ = """
[email protected] (Martin J. Bligh),
 [email protected] (Benjamin Poirier),
[email protected] (Ryan Stutsman)"""
[email protected] (Ryan Stutsman)
+"""
 
 
 import time
@@ -22,49 +25,61 @@
 import bootloader
 
 class Host(object):
-	"""This class represents a machine on which you can run programs.
-	
+	"""
+	This class represents a machine on which you can run programs.
+
 	It may be a local machine, the one autoserv is running on, a remote 
 	machine or a virtual machine.
-	
+
 	Implementation details:
 	This is an abstract class, leaf subclasses must implement the methods
 	listed here. You must not instantiate this class but should 
-	instantiate one of those leaf subclasses."""
-	
+	instantiate one of those leaf subclasses.
+	"""
+
 	bootloader = None
-	
+
 	def __init__(self):
 		super(Host, self).__init__()
 		self.bootloader= bootloader.Bootloader(self)
-	
+
+
 	def run(self, command):
 		pass
-	
+
+
 	def reboot(self):
 		pass
-	
+
+
 	def get_file(self, source, dest):
 		pass
-	
+
+
 	def send_file(self, source, dest):
 		pass
-	
+
+
 	def get_tmp_dir(self):
 		pass
-	
+
+
 	def is_up(self):
 		pass
-	
+
+
 	def wait_up(self, timeout):
 		pass
-	
+
+
 	def wait_down(self, timeout):
 		pass
-	
+
+
 	def get_num_cpu(self):
 		pass
-	
+
+
 	def install(self, installableObject):
 		installableObject.install(self)
 
@@ -85,19 +100,19 @@
 class RemoteHost(SiteHost):
 	"""This class represents a remote machine on which you can run 
 	programs.
-	
+
 	It may be accessed through a network, a serial line, ...
 	It is not the machine autoserv is running on.
-	
+
 	Implementation details:
 	This is an abstract class, leaf subclasses must implement the methods
 	listed here and in parent classes which have no implementation. They 
 	may reimplement methods which already have an implementation. You 
 	must not instantiate this class but should instantiate one of those 
 	leaf subclasses."""
-	
+
 	hostname= None
-	
+
 	def __init__(self):
 		super(RemoteHost, self).__init__()
 
@@ -105,12 +120,12 @@
 class CmdResult(object):
 	"""
 	Command execution result.
-	
+
 	Modified from the original Autoserv code, local_cmd.py:
 		Copyright [email protected] (Jonathan Mayer),
 		[email protected]   (Martin J. Bligh)
 		Released under the GPL, v2
-	
+
 	command: String containing the command line itself
 	exit_status: Integer exit code of the process
 	stdout: String containing stdout of the process
@@ -118,7 +133,7 @@
 	duration: Elapsed wall clock time running the process
 	aborted: Signal that caused the command to terminate (0 if none)
 	"""
-	
+
 	def __init__(self):
 		super(CmdResult, self).__init__()
 		self.command = ""
@@ -127,7 +142,8 @@
 		self.stderr = ""
 		self.duration = 0
 		self.aborted= False
-	
+
+
 	def __repr__(self):
 		wrapper= textwrap.TextWrapper(width=78, 
 			initial_indent="\n    ", subsequent_indent="    ")
diff --git a/server/hosts/bootloader.py b/server/hosts/bootloader.py
index a7f717e..cd79283 100644
--- a/server/hosts/bootloader.py
+++ b/server/hosts/bootloader.py
@@ -2,14 +2,17 @@
 #
 # Copyright 2007 Google Inc. Released under the GPL v2
 
-"""This module defines the Bootloader class.
+"""
+This module defines the Bootloader class.
 
 	Bootloader: a program to boot Kernels on a Host.
 """
 
-__author__ = """[email protected] (Martin J. Bligh),
+__author__ = """
[email protected] (Martin J. Bligh),
 [email protected] (Benjamin Poirier),
[email protected] (Ryan Stutsman)"""
[email protected] (Ryan Stutsman)
+"""
 
 import os.path
 import sys
@@ -23,31 +26,38 @@
 
 
 class Bootloader(object):
-	"""This class represents a bootloader.
-	
+	"""
+	This class represents a bootloader.
+
 	It can be used to add a kernel to the list of kernels that can be 
 	booted by a bootloader. It can also make sure that this kernel will 
-	be the one chosen at next reboot."""
-	
+	be the one chosen at next reboot.
+	"""
+
 	def __init__(self, host, xen_mode=False):
 		super(Bootloader, self).__init__()
 		self.__host = weakref.ref(host)
 		self.__boottool_path = None
 		self.xen_mode = xen_mode
-	
+
+
 	def get_type(self):
 		return self.__run_boottool('--bootloader-probe').stdout.strip()
-	
+
+
 	def get_architecture(self):
 		return self.__run_boottool('--arch-probe').stdout.strip()
-	
+
+
 	def get_titles(self):
 		return self.__run_boottool('--info all | grep title | '
 			'cut -d " " -f2-').stdout.strip().split('\n')
-	
+
+
 	def get_default(self):
 		return self.__run_boottool('--default').stdout.strip()
-	
+
+
 	def get_info(self, index):
 		retval= self.__run_boottool(
 			'--info=%s' % index).stdout.strip().split("\n")
@@ -58,10 +68,12 @@
 			result[key.strip()]= val.strip()
 		
 		return result
-	
+
+
 	def set_default(self, index):
 		self.__run_boottool('--set-default=%s' % index)
-	
+
+
 	# 'kernel' can be a position number or a title
 	def add_args(self, kernel, args):
 		parameters = '--update-kernel=%s --args="%s"' % (kernel, args)
@@ -71,11 +83,13 @@
 			parameters += ' --xen'
 		
 		self.__run_boottool(parameters)
-	
+
+
 	def add_xen_hypervisor_args(self, kernel, args):
 		self.__run_boottool('--xen --update-xenhyper=%s --xha="%s"' \
 				    % (kernel, args))
-	
+
+
 	def remove_args(self, kernel, args):
 		params = '--update-kernel=%s --remove-args=%s' % (kernel, args)
 		
@@ -84,11 +98,13 @@
 			params += ' --xen'
 		
 		self.__run_boottool(params)
-	
+
+
 	def remove_xen_hypervisor_args(self, kernel, args):
 		self.__run_boottool('--xen --update-xenhyper=%s '
 			'--remove-args="%s"') % (kernel, args)
-	
+
+
 	def add_kernel(self, path, title='autoserv', root=None, args=None, 
 		initrd=None, xen_hypervisor=None, default=True):
 		"""
@@ -124,13 +140,16 @@
 					utils.sh_escape(xen_hypervisor),)
 		
 		self.__run_boottool(parameters)
-	
+
+
 	def remove_kernel(self, kernel):
 		self.__run_boottool('--remove-kernel=%s' % kernel)
-	
+
+
 	def boot_once(self, title):
 		self.__run_boottool('--boot-once --title=%s' % title)
-	
+
+
 	def __install_boottool(self):
 		if self.__host() is None:
 			raise errors.AutoservError("Host does not exist anymore")
@@ -139,16 +158,20 @@
 			os.path.dirname(sys.argv[0]), BOOTTOOL_SRC)), tmpdir)
 		self.__boottool_path= os.path.join(tmpdir, 
 			os.path.basename(BOOTTOOL_SRC))
-	
+
+
 	def __get_boottool_path(self):
 		if not self.__boottool_path:
 			self.__install_boottool()
 		return self.__boottool_path
-	
+
+
 	def __set_boottool_path(self, path):
 		self.__boottool_path = path
+
 	
 	boottool_path = property(__get_boottool_path, __set_boottool_path)
-	
+
+
 	def __run_boottool(self, cmd):
 		return self.__host().run(self.boottool_path + ' ' + cmd)
diff --git a/server/hosts/conmux_ssh_host.py b/server/hosts/conmux_ssh_host.py
index e012abd..49c0248 100644
--- a/server/hosts/conmux_ssh_host.py
+++ b/server/hosts/conmux_ssh_host.py
@@ -2,7 +2,8 @@
 #
 # Copyright 2007 Google Inc. Released under the GPL v2
 
-"""This module defines the ConmuxSSHHost
+"""
+This module defines the ConmuxSSHHost
 
 Implementation details:
 You should import the "hosts" package instead of importing each type of host.
@@ -10,9 +11,11 @@
 	ConmuxSSHHost: a remote machine controlled through a serial console
 """
 
-__author__ = """[email protected] (Martin J. Bligh),
+__author__ = """
[email protected] (Martin J. Bligh),
 [email protected] (Benjamin Poirier),
[email protected] (Ryan Stutsman)"""
[email protected] (Ryan Stutsman)
+"""
 
 import os
 import os.path
@@ -25,14 +28,17 @@
 import errors
 
 class ConmuxSSHHost(ssh_host.SSHHost):
-	"""This class represents a remote machine controlled through a serial 
+	"""
+	This class represents a remote machine controlled through a serial 
 	console on which you can run programs. It is not the machine autoserv 
 	is running on.
-	
+
 	For a machine controlled in this way, it may be possible to support 
 	hard reset, boot strap monitoring or other operations not possible 
-	on a machine controlled through ssh, telnet, ..."""
-	
+	on a machine controlled through ssh, telnet, ...
+	"""
+
+
 	def __init__(self,
 		     hostname,
 		     logfilename=None,
@@ -45,7 +51,7 @@
 		self.pid = None
 		self.__start_console_log(logfilename)
 
-	
+
 	def hardreset(self):
 		"""
 		Reach out and slap the box in the power switch
@@ -66,7 +72,7 @@
 		cmd = [self.attach, to, 'cat - > %s' % logfilename]
 		self.pid = subprocess.Popen(cmd).pid
 
-		
+	
 	def __find_console_attach(self):
 		if self.attach:
 			return self.attach
@@ -117,4 +123,4 @@
 			except OSError:
 				pass
 		super(ConmuxSSHHost, self).__del__()
-		
+	
diff --git a/server/hosts/guest.py b/server/hosts/guest.py
index 3fc6ea9..f75e90b 100644
--- a/server/hosts/guest.py
+++ b/server/hosts/guest.py
@@ -2,7 +2,8 @@
 #
 # Copyright 2007 Google Inc. Released under the GPL v2
 
-"""This module defines the Guest class in the Host hierarchy.
+"""
+This module defines the Guest class in the Host hierarchy.
 
 Implementation details:
 You should import the "hosts" package instead of importing each type of host.
@@ -10,16 +11,19 @@
 	Guest: a virtual machine on which you can run programs
 """
 
-__author__ = """[email protected] (Martin J. Bligh),
+__author__ = """
[email protected] (Martin J. Bligh),
 [email protected] (Benjamin Poirier),
[email protected] (Ryan Stutsman)"""
[email protected] (Ryan Stutsman)
+"""
 
 
 import ssh_host
 
 
 class Guest(ssh_host.SSHHost):
-	"""This class represents a virtual machine on which you can run 
+	"""
+	This class represents a virtual machine on which you can run 
 	programs.
 	
 	It is not the machine autoserv is running on.
@@ -29,12 +33,15 @@
 	listed here and in parent classes which have no implementation. They 
 	may reimplement methods which already have an implementation. You 
 	must not instantiate this class but should instantiate one of those 
-	leaf subclasses."""
+	leaf subclasses.
+	"""
 	
 	controlling_hypervisor = None
+
 	
 	def __init__(self, controlling_hypervisor):
-		"""Construct a Guest object
+		"""
+		Construct a Guest object
 		
 		Args:
 			controlling_hypervisor: Hypervisor object that is 
@@ -44,14 +51,18 @@
 		hostname= controlling_hypervisor.new_guest()
 		super(Guest, self).__init__(hostname)
 		self.controlling_hypervisor= controlling_hypervisor
+
 	
 	def __del__(self):
-		"""Destroy a Guest object
+		"""
+		Destroy a Guest object
 		"""
 		self.controlling_hypervisor.delete_guest(self.hostname)
+
 	
 	def hardreset(self):
-		"""Perform a "hardreset" of the guest.
+		"""
+		Perform a "hardreset" of the guest.
 		
 		It is restarted through the hypervisor. That will restart it 
 		even if the guest otherwise innaccessible through ssh.
diff --git a/server/hosts/kvm_guest.py b/server/hosts/kvm_guest.py
index abddd0f..a676cba 100644
--- a/server/hosts/kvm_guest.py
+++ b/server/hosts/kvm_guest.py
@@ -2,7 +2,8 @@
 #
 # Copyright 2007 Google Inc. Released under the GPL v2
 
-"""This module defines the Host class.
+"""
+This module defines the Host class.
 
 Implementation details:
 You should import the "hosts" package instead of importing each type of host.
@@ -10,9 +11,11 @@
 	KVMGuest: a KVM virtual machine on which you can run programs
 """
 
-__author__ = """[email protected] (Martin J. Bligh),
+__author__ = """
[email protected] (Martin J. Bligh),
 [email protected] (Benjamin Poirier),
[email protected] (Ryan Stutsman)"""
[email protected] (Ryan Stutsman)
+"""
 
 
 import guest
@@ -28,7 +31,8 @@
 	"""
 	
 	def __init__(self, controlling_hypervisor, qemu_options):
-		"""Construct a KVMGuest object
+		"""
+		Construct a KVMGuest object
 		
 		Args:
 			controlling_hypervisor: hypervisor object that is 
diff --git a/server/hosts/site_host.py b/server/hosts/site_host.py
index d5ebfc7..96540be 100644
--- a/server/hosts/site_host.py
+++ b/server/hosts/site_host.py
@@ -2,7 +2,8 @@
 #
 # Copyright 2007 Google Inc. Released under the GPL v2
 
-"""This module defines the SiteHost class.
+"""
+This module defines the SiteHost class.
 
 This file may be removed or left empty if no site customization is neccessary.
 base_classes.py contains logic to provision for this.
@@ -13,20 +14,24 @@
 	SiteHost: Host containing site-specific customizations.
 """
 
-__author__ = """[email protected] (Martin J. Bligh),
+__author__ = """
[email protected] (Martin J. Bligh),
 [email protected] (Benjamin Poirier),
[email protected] (Ryan Stutsman)"""
[email protected] (Ryan Stutsman)
+"""
 
 
 import base_classes
 
 
 class SiteHost(base_classes.Host):
-	"""Custom host to containing site-specific methods or attributes.
+	"""
+	Custom host to containing site-specific methods or attributes.
 	"""
 	
 	def __init__(self):
 		super(SiteHost, self).__init__()
+
 	
 	#def get_platform(self):
 		#...
diff --git a/server/hosts/ssh_host.py b/server/hosts/ssh_host.py
index 8619bc4..3c8ddf8 100644
--- a/server/hosts/ssh_host.py
+++ b/server/hosts/ssh_host.py
@@ -2,7 +2,8 @@
 #
 # Copyright 2007 Google Inc. Released under the GPL v2
 
-"""This module defines the SSHHost class.
+"""
+This module defines the SSHHost class.
 
 Implementation details:
 You should import the "hosts" package instead of importing each type of host.
@@ -10,9 +11,11 @@
 	SSHHost: a remote machine with a ssh access
 """
 
-__author__ = """[email protected] (Martin J. Bligh),
+__author__ = """
[email protected] (Martin J. Bligh),
 [email protected] (Benjamin Poirier),
[email protected] (Ryan Stutsman)"""
[email protected] (Ryan Stutsman)
+"""
 
 
 import types
@@ -25,20 +28,22 @@
 
 
 class SSHHost(base_classes.RemoteHost):
-	"""This class represents a remote machine controlled through an ssh 
+	"""
+	This class represents a remote machine controlled through an ssh 
 	session on which you can run programs.
-	
+
 	It is not the machine autoserv is running on. The machine must be 
 	configured for password-less login, for example through public key 
 	authentication.
-	
+
 	Implementation details:
 	This is a leaf class in an abstract class hierarchy, it must 
 	implement the unimplemented methods in parent classes.
 	"""
-	
+
 	def __init__(self, hostname, user="root", port=22):
-		"""Construct a SSHHost object
+		"""
+		Construct a SSHHost object
 		
 		Args:
 			hostname: network hostname or address of remote machine
@@ -52,18 +57,22 @@
 		self.user= user
 		self.port= port
 		self.tmp_dirs= []
-	
+
+
 	def __del__(self):
-		"""Destroy a SSHHost object
+		"""
+		Destroy a SSHHost object
 		"""
 		for dir in self.tmp_dirs:
 			try:
 				self.run('rm -rf "%s"' % (utils.sh_escape(dir)))
 			except errors.AutoservRunError:
 				pass
-	
+
+
 	def run(self, command, timeout=None, ignore_status=False):
-		"""Run a command on the remote host.
+		"""
+		Run a command on the remote host.
 		
 		Args:
 			command: the command line string
@@ -84,9 +93,11 @@
 			self.port, self.hostname, utils.sh_escape(command)), 
 			timeout, ignore_status)
 		return result
-	
+
+
 	def reboot(self):
-		"""Reboot the remote host.
+		"""
+		Reboot the remote host.
 		
 		TODO(poirier): Should the function return only after having 
 			done a self.wait_down()? or should this be left to 
@@ -111,9 +122,10 @@
 		"""
 		self.run("reboot")
 		self.wait_down()
-	
+
 	def get_file(self, source, dest):
-		"""Copy files from the remote host to a local path.
+		"""
+		Copy files from the remote host to a local path.
 		
 		Directories will be copied recursively.
 		If a source component is a directory with a trailing slash, 
@@ -155,9 +167,11 @@
 		utils.run('scp -rpq %s "%s"' % (
 			" ".join(processed_source), 
 			processed_dest))
-	
+
+
 	def send_file(self, source, dest):
-		"""Copy files from a local path to the remote host.
+		"""
+		Copy files from a local path to the remote host.
 		
 		Directories will be copied recursively.
 		If a source component is a directory with a trailing slash, 
@@ -192,9 +206,11 @@
 		utils.run('scp -rpq %s %s@%s:"%s"' % (
 			" ".join(processed_source), self.user, self.hostname, 
 			utils.scp_remote_escape(dest)))
-	
+
+
 	def get_tmp_dir(self):
-		"""Return the pathname of a directory on the host suitable 
+		"""
+		Return the pathname of a directory on the host suitable 
 		for temporary file storage.
 		
 		The directory and its content will be deleted automatically
@@ -204,9 +220,11 @@
 		dir_name= self.run("mktemp -dt autoserv-XXXXXX").stdout.rstrip(" \n")
 		self.tmp_dirs.append(dir_name)
 		return dir_name
-	
+
+
 	def is_up(self):
-		"""Check if the remote host is up.
+		"""
+		Check if the remote host is up.
 		
 		Returns:
 			True if the remote host is up, False otherwise
@@ -219,10 +237,12 @@
 			if result.exit_status == 0:
 				return True
 			else:
+
 				return False
-	
+
 	def wait_up(self, timeout=None):
-		"""Wait until the remote host is up or the timeout expires.
+		"""
+		Wait until the remote host is up or the timeout expires.
 		
 		In fact, it will wait until an ssh connection to the remote 
 		host can be established.
@@ -252,9 +272,11 @@
 			time.sleep(1)
 		
 		return False
-	
+
+
 	def wait_down(self, timeout=None):
-		"""Wait until the remote host is down or the timeout expires.
+		"""
+		Wait until the remote host is down or the timeout expires.
 		
 		In fact, it will wait until an ssh connection to the remote 
 		host fails.
@@ -281,17 +303,22 @@
 			time.sleep(1)
 		
 		return False
-	
+
+
 	def ensure_up(self):
-		"""Ensure the host is up if it is not then do not proceed;
-		this prevents cacading failures of tests"""
+		"""
+		Ensure the host is up if it is not then do not proceed;
+		this prevents cacading failures of tests
+		"""
 		if not self.wait_up(300) and hasattr(self, 'hardreset'):
 			print "Performing a hardreset on %s" % self.hostname
 			self.hardreset()
 		self.wait_up()
-	
+
+
 	def get_num_cpu(self):
-		"""Get the number of CPUs in the host according to 
+		"""
+		Get the number of CPUs in the host according to 
 		/proc/cpuinfo.
 		
 		Returns: