duration = 1
fsz_mb = os.stat(source).st_size / units.Mi
mbps = (fsz_mb / duration)
- LOG.debug('Image conversion details: src %(src)s, size %(sz).2f MB, '
- 'duration %(duration).2f, destination %(dest)s',
- {'src': source,
- 'sz': fsz_mb,
- 'duration': duration,
- 'dest': dest})
- LOG.info(_('Converted %(sz).2f MB image at %(mbps).2f MB/s'),
- {'sz': fsz_mb, 'mbps': mbps})
+ msg = ("Image conversion details: src %(src)s, size %(sz).2f MB, "
+ "duration %(duration).2f sec, destination %(dest)s")
+ LOG.debug(msg % {"src": source,
+ "sz": fsz_mb,
+ "duration": duration,
+ "dest": dest})
+
+ msg = _("Converted %(sz).2f MB image at %(mbps).2f MB/s")
+ LOG.info(msg % {"sz": fsz_mb, "mbps": mbps})
def resize_image(source, size, run_as_root=False):
duration = 1
fsz_mb = os.stat(image_file.name).st_size / units.Mi
mbps = (fsz_mb / duration)
- LOG.debug('Image fetch details: dest %(dest)s, size %(sz).2f MB, '
- 'duration %(duration).2f sec',
- {'dest:': image_file.name, 'sz': fsz_mb, 'duration': duration})
- LOG.info(_('Image download %(sz).2f MB at %(mbps).2f MB/s'),
- {'sz': fsz_mb, 'mbps': mbps})
+ msg = ("Image fetch details: dest %(dest)s, size %(sz).2f MB, "
+ "duration %(duration).2f sec")
+ LOG.debug(msg % {"dest": image_file.name,
+ "sz": fsz_mb,
+ "duration": duration})
+ msg = _("Image download %(sz).2f MB at %(mbps).2f MB/s")
+ LOG.info(msg % {"sz": fsz_mb, "mbps": mbps})
def fetch_verify_image(context, image_service, image_id, dest,
if duration < 1:
duration = 1
mbps = (size_in_m / duration)
- LOG.debug(('Volume copy details: src %(src)s, dest %(dest)s, '
- 'size %(sz).2f MB, duration %(duration).2f sec'),
- {'src': srcstr,
- 'dest': deststr,
- 'sz': size_in_m,
- 'duration': duration})
- LOG.info(_('Volume copy %(sz).2f MB at %(mbps).2f MB/s'),
- {'sz': size_in_m, 'duration': mbps})
+ mesg = ("Volume copy details: src %(src)s, dest %(dest)s, "
+ "size %(sz).2f MB, duration %(duration).2f sec")
+ LOG.debug(mesg % {"src": srcstr,
+ "dest": deststr,
+ "sz": size_in_m,
+ "duration": duration})
+ mesg = _("Volume copy %(size_in_m).2f MB at %(mbps).2f MB/s")
+ LOG.info(mesg % {'size_in_m': size_in_m, 'mbps': mbps})
def clear_volume(volume_size, volume_path, volume_clear=None,