diff --git a/tuf/__init__.py b/tuf/__init__.py index 503e4fcf..13964980 100755 --- a/tuf/__init__.py +++ b/tuf/__init__.py @@ -134,9 +134,9 @@ def __init__(self, metadata_role, previous_version, current_version): def __str__(self): - return str(self.metadata_role)+' is older than the version currently'+\ - 'installed.\nDownloaded version: '+repr(self.previous_version)+'\n'+\ - 'Current version: '+repr(self.current_version) + return 'Downloaded '+str(self.metadata_role)+' is older ('+\ + str(self.previous_version)+') than the version currently '+\ + 'installed ('+repr(self.current_version)+').' diff --git a/tuf/client/updater.py b/tuf/client/updater.py index 1d924f8c..fc1f9d3c 100755 --- a/tuf/client/updater.py +++ b/tuf/client/updater.py @@ -1021,7 +1021,7 @@ def __get_file(self, filepath, verify_uncompressed_file, file_type, except Exception, exception: # Remember the error from this mirror, and "reset" the target file. - logger.exception('Download failed from '+file_mirror+'.') + logger.exception('Update failed from '+file_mirror+'.') file_mirror_errors[file_mirror] = exception file_object = None else: @@ -1030,8 +1030,8 @@ def __get_file(self, filepath, verify_uncompressed_file, file_type, if file_object: return file_object else: - logger.exception('Failed to download {0}: {1}'.format(filepath, - file_mirror_errors)) + logger.exception('Failed to update {0} from all mirrors: {1}'.format( + filepath, file_mirror_errors)) raise tuf.NoWorkingMirrorError(file_mirror_errors) @@ -1744,6 +1744,7 @@ def _ensure_not_expired(self, metadata_role): # returned by time.time() (i.e., current time), before comparing. if tuf.formats.parse_time(expires) < time.time(): message = 'Metadata '+repr(rolepath)+' expired on '+repr(expires)+'.' + logger.error(message) raise tuf.ExpiredMetadataError(message) diff --git a/tuf/log.py b/tuf/log.py index 7987ec94..347cca63 100755 --- a/tuf/log.py +++ b/tuf/log.py @@ -141,8 +141,11 @@ def filter(self, record): # most useful for the console handler, which we do not wish to deluge # with too much data. Assuming that this filter is not applied to the # file logging handler, the user may always consult the file log for the - # original exception traceback. - record.exc_text = str(record.exc_info) + # original exception traceback. The exc_info is explained here: + # http://docs.python.org/2/library/sys.html#sys.exc_info + exc_type, exc_value, exc_traceback = record.exc_info + # Simply set the class name as the exception text. + record.exc_text = exc_type.__name__ # Always return True to signal that any given record must be formatted. return True diff --git a/tuf/tests/repository_setup.py b/tuf/tests/repository_setup.py old mode 100755 new mode 100644 diff --git a/tuf/tests/unittest_toolbox.py b/tuf/tests/unittest_toolbox.py old mode 100755 new mode 100644