Merge remote-tracking branch 'upstream/demo2' into demo2

This commit is contained in:
zanefisher 2013-09-14 16:47:36 -04:00
commit 0ff714cd40
5 changed files with 12 additions and 8 deletions

View file

@ -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)+').'

View file

@ -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)

View file

@ -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

0
tuf/tests/repository_setup.py Executable file → Normal file
View file

0
tuf/tests/unittest_toolbox.py Executable file → Normal file
View file