Don't log an ERROR about non-fatal package fetches failures.  Put those
in the DEBUG log and only log an error if all package fetch attempts
failed.  Also cleans up the unused error_msgs local.

Signed-off-by: Gregory Smith <[email protected]>

--- autotest/client/common_lib/base_packages.py 2010-06-07 12:55:55.000000000 
-0700
+++ autotest/client/common_lib/base_packages.py 2010-06-07 12:55:55.000000000 
-0700
@@ -399,7 +399,6 @@
         else:
             raise error.PackageFetchError("No repository urls specified")
 
-        error_msgs = {}
         # install the package from the package repos, try the repos in
         # reverse order, assuming that the 'newest' repos are most desirable
         for fetcher in reversed(repositories):
@@ -414,16 +413,16 @@
                 return
             except (error.PackageFetchError, error.AutoservRunError):
                 # The package could not be found in this repo, continue looking
-                logging.error('%s could not be fetched from %s', pkg_name,
+                logging.debug('%s could not be fetched from %s', pkg_name,
                               fetcher.url)
 
+        message = ('%s could not be fetched from any of the repos %s' %
+                   (pkg_name, repo_url_list))
+        logging.error(message)
         # if we got here then that means the package is not found
         # in any of the repositories.
         repo_url_list = [repo.url for repo in repositories]
-        raise error.PackageFetchError("%s could not be fetched from any of"
-                                      " the repos %s : %s " % (pkg_name,
-                                                               repo_url_list,
-                                                               error_msgs))
+        raise error.PackageFetchError(message)
 
 
     def upload_pkg(self, pkg_path, upload_path=None, update_checksum=False):
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to