diff --git a/oslo_utils/excutils.py b/oslo_utils/excutils.py index ae5f7e31..a3b15bf1 100644 --- a/oslo_utils/excutils.py +++ b/oslo_utils/excutils.py @@ -274,8 +274,8 @@ def forever_retry_uncaught_exceptions(*args, **kwargs): # The watch has expired or the exception message # changed, so time to log it again... logging.exception( - 'Unexpected exception occurred %d time(s)... ' - 'retrying.' % same_failure_count + f'Unexpected exception occurred ' + f'{same_failure_count} time(s)... retrying.' ) if not watch.has_started(): watch.start() diff --git a/oslo_utils/imageutils/format_inspector.py b/oslo_utils/imageutils/format_inspector.py index 329fcfb1..5433e435 100644 --- a/oslo_utils/imageutils/format_inspector.py +++ b/oslo_utils/imageutils/format_inspector.py @@ -792,7 +792,7 @@ class VHDXInspector(FileInspector): ) if count >= 2048: - raise ImageFormatError('Region count is %i (limit 2047)' % count) + raise ImageFormatError('Region count is {int(count)} (limit 2047)') # Process the regions until we find the metadata one; grab the # offset and return @@ -849,7 +849,7 @@ class VHDXInspector(FileInspector): if count >= 2048: raise ImageFormatError( - 'Metadata item count is %i (limit 2047)' % count + 'Metadata item count is {int(count)} (limit 2047)' ) for i in range(0, count): @@ -1003,7 +1003,7 @@ class VMDKInspector(FileInspector): raise ImageFormatError(f'Signature KDMV not found: {sig!r}') if ver not in (1, 2, 3): - raise ImageFormatError('Unsupported format version %i' % ver) + raise ImageFormatError('Unsupported format version {int(ver)}') if gdOffset == self.GD_AT_END and not self.has_region('footer'): # This means we have a footer, which takes precedence over the @@ -1364,7 +1364,9 @@ class GPTInspector(FileInspector): sizelba, ) = struct.unpack('