Server side messages cleanup. In this patch, the aim was:

 * Fix issues with spacing on some messages
 * Make server output coherent with client output
 * Remove verbosity turned obsolete by the logging system
 (it's not necessary to manually prepend debug messages with the method they
 belong to)

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3398 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tools/make_clean b/client/tools/make_clean
index 7f7bd33..51cf2ba 100755
--- a/client/tools/make_clean
+++ b/client/tools/make_clean
@@ -17,7 +17,7 @@
         else:
             cmd = 'cd %s; make clean > /dev/null 2>&1 ' % src_path
 
-        print cmd
+        print 'Cleaning %s test dir' % dir
         os.system(cmd)
 
 
diff --git a/server/autotest.py b/server/autotest.py
index 0b6f6af..d347e79 100644
--- a/server/autotest.py
+++ b/server/autotest.py
@@ -125,7 +125,7 @@
             self.lightweight = lightweight
             return
         except global_config.ConfigError, e:
-            logging.error("Could not install autotest using the packaging"
+            logging.error("Could not install autotest using the packaging "
                           "system: %s",  e)
         except (packages.PackageInstallError, error.AutoservRunError), e:
             logging.error("Could not install autotest from %s", repos)
diff --git a/server/hosts/abstract_ssh.py b/server/hosts/abstract_ssh.py
index 9548264..a3b26c7 100644
--- a/server/hosts/abstract_ssh.py
+++ b/server/hosts/abstract_ssh.py
@@ -265,8 +265,8 @@
                                          delete_dest, preserve_symlinks)
             utils.run(rsync)
         except error.CmdError, e:
-            logging.warn("warning: rsync failed with: %s", e)
-            logging.info("attempting to copy with scp instead")
+            logging.warn("Command rsync failed with: %s", e)
+            logging.info("Attempting to copy with scp instead")
 
             # scp has no equivalent to --delete, just drop the entire dest dir
             if delete_dest:
@@ -294,9 +294,9 @@
     def ssh_ping(self, timeout=60):
         try:
             self.run("true", timeout=timeout, connect_timeout=timeout)
-            logging.info("ssh_ping of %s completed sucessfully", self.hostname)
+            logging.info("Host (ssh) %s is alive", self.hostname)
         except error.AutoservSSHTimeout:
-            msg = "ssh ping timed out (timeout = %d)" % timeout
+            msg = "Host (ssh) verify timed out (timeout = %d)" % timeout
             raise error.AutoservSSHTimeout(msg)
         except error.AutoservSshPermissionDeniedError:
             #let AutoservSshPermissionDeniedError be visible to the callers
diff --git a/server/hosts/logfile_monitor.py b/server/hosts/logfile_monitor.py
index 03a64f3..158fad9 100644
--- a/server/hosts/logfile_monitor.py
+++ b/server/hosts/logfile_monitor.py
@@ -57,7 +57,7 @@
 
 def launch_remote_followfiles(host, lastlines_dirpath, follow_paths):
     """Launch followfiles.py remotely on follow_paths."""
-    logging.info('logfile_monitor: Launching followfiles on target: %s, %s, %s',
+    logging.info('Launching followfiles on target: %s, %s, %s',
                  host.hostname, lastlines_dirpath, str(follow_paths))
 
     # First make sure a supported Python is on host
@@ -65,8 +65,8 @@
     supported_python = select_supported_python(installed_pythons)
     if not supported_python:
         if DEFAULT_PYTHON in installed_pythons:
-            logging.info('logfile_monitor: No versioned Python binary found,'
-                         ' defaulting to: %s', DEFAULT_PYTHON)
+            logging.info('No versioned Python binary found, '
+                         'defaulting to: %s', DEFAULT_PYTHON)
             supported_python = DEFAULT_PYTHON
         else:
             raise FollowFilesLaunchError('No supported Python on host.')
@@ -88,7 +88,7 @@
     time.sleep(5)
     doa = remote_followfiles_proc.poll()
     if doa:
-        raise FollowFilesLaunchError('SSH command crashed.')
+        raise FollowFilesLaunchError('ssh command crashed.')
 
     return remote_followfiles_proc
 
@@ -221,7 +221,7 @@
         missing = follow_paths_set.difference(existing)
         if missing:
             # Log warning that we are missing expected remote paths.
-            logging.warn('Target(%s) missing expected remote paths: %s',
+            logging.warn('Target %s is missing expected remote paths: %s',
                          self.hostname, ', '.join(missing))
 
         # If none of them exist just return (for now).
diff --git a/server/hosts/paramiko_host.py b/server/hosts/paramiko_host.py
index 3b80cdf..975c3c8 100644
--- a/server/hosts/paramiko_host.py
+++ b/server/hosts/paramiko_host.py
@@ -221,7 +221,7 @@
         stderr = utils.get_stream_tee_file(stderr_tee, logging.ERROR)
 
         if verbose:
-            logging.debug("ssh-paramiko: %s" % command)
+            logging.debug("Running (ssh-paramiko) '%s'" % command)
 
         # start up the command
         start_time = time.time()
diff --git a/server/hosts/ssh_host.py b/server/hosts/ssh_host.py
index adb8154..d5b4ad7 100644
--- a/server/hosts/ssh_host.py
+++ b/server/hosts/ssh_host.py
@@ -113,7 +113,7 @@
             AutoservSSHTimeout: ssh connection has timed out
         """
         if verbose:
-            logging.debug("ssh: %s" % command)
+            logging.debug("Running (ssh) '%s'" % command)
         env = " ".join("=".join(pair) for pair in self.env.iteritems())
         try:
             return self._run(command, timeout, ignore_status, stdout_tee,