summaryrefslogtreecommitdiff
path: root/ironic_python_agent/extensions
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-08-11 10:02:24 +0000
committerGerrit Code Review <review@openstack.org>2021-08-11 10:02:24 +0000
commit71f54b7f9864b0cb51e59b3a157df986302b6073 (patch)
treedfcd920b93ad81ead50c6da279e9b3b9c291473d /ironic_python_agent/extensions
parent91f0248164bf1f9fa072021e0b657ec55510127a (diff)
parentefbbc86f53f8b6dc21a847088c3914e13a439017 (diff)
downloadironic-python-agent-71f54b7f9864b0cb51e59b3a157df986302b6073.tar.gz
Merge "Increase version of hacking and pycodestyle"
Diffstat (limited to 'ironic_python_agent/extensions')
-rw-r--r--ironic_python_agent/extensions/image.py5
-rw-r--r--ironic_python_agent/extensions/standby.py34
2 files changed, 24 insertions, 15 deletions
diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py
index 84e86f17..697a1d95 100644
--- a/ironic_python_agent/extensions/image.py
+++ b/ironic_python_agent/extensions/image.py
@@ -489,8 +489,9 @@ def _prepare_boot_partitions_for_softraid(device, holders, efi_part,
# RAID the ESPs, metadata=1.0 is mandatory to be able to boot
md_device = '/dev/md/esp'
- LOG.debug("Creating md device {} for the ESPs on {}".format(
- md_device, efi_partitions))
+ LOG.debug("Creating md device %(md_device)s for the ESPs "
+ "on %(efi_partitions)s",
+ {'md_device': md_device, 'efi_partitions': efi_partitions})
utils.execute('mdadm', '--create', md_device, '--force',
'--run', '--metadata=1.0', '--level', '1',
'--raid-devices', len(efi_partitions),
diff --git a/ironic_python_agent/extensions/standby.py b/ironic_python_agent/extensions/standby.py
index 970cf7de..e63a9572 100644
--- a/ironic_python_agent/extensions/standby.py
+++ b/ironic_python_agent/extensions/standby.py
@@ -202,7 +202,7 @@ def _write_whole_disk_image(image, image_info, device):
command = ['qemu-img', 'convert',
'-t', 'directsync', '-O', 'host_device', '-W',
image, device]
- LOG.info('Writing image with command: {}'.format(' '.join(command)))
+ LOG.info('Writing image with command: %s', ' '.join(command))
try:
disk_utils.convert_image(image, device, out_format='host_device',
cache='directsync', out_of_order=True)
@@ -232,8 +232,9 @@ def _write_image(image_info, device, configdrive=None):
else:
_write_whole_disk_image(image, image_info, device)
totaltime = time.time() - starttime
- LOG.info('Image {} written to device {} in {} seconds'.format(
- image, device, totaltime))
+ LOG.info('Image %(image)s written to device %(device)s in %(totaltime)s '
+ 'seconds', {'image': image, 'device': device,
+ 'totaltime': totaltime})
try:
disk_utils.fix_gpt_partition(device, node_uuid=None)
except exception.InstanceDeployFailure:
@@ -329,7 +330,7 @@ class ImageDownload(object):
details = []
for url in image_info['urls']:
try:
- LOG.info("Attempting to download image from {}".format(url))
+ LOG.info("Attempting to download image from %s", url)
self._request = _download_with_proxy(image_info, url,
image_info['id'])
except errors.ImageDownloadError as e:
@@ -386,12 +387,16 @@ class ImageDownload(object):
not match the checksum as reported by glance in image_info.
"""
checksum = self._hash_algo.hexdigest()
- LOG.debug('Verifying image at {} against {} checksum '
- '{}'.format(image_location, self._hash_algo.name, checksum))
+ LOG.debug('Verifying image at %(image_location)s against '
+ '%(algo_name)s checksum %(checksum)s',
+ {'image_location': image_location,
+ 'algo_name': self._hash_algo.name,
+ 'checksum': checksum})
if checksum != self._expected_hash_value:
- LOG.error(errors.ImageChecksumError.details_str.format(
+ error_msg = errors.ImageChecksumError.details_str.format(
image_location, self._image_info['id'],
- self._expected_hash_value, checksum))
+ self._expected_hash_value, checksum)
+ LOG.error(error_msg)
raise errors.ImageChecksumError(image_location,
self._image_info['id'],
self._expected_hash_value,
@@ -434,8 +439,10 @@ def _download_image(image_info):
break
totaltime = time.time() - starttime
- LOG.info("Image downloaded from {} in {} seconds".format(image_location,
- totaltime))
+ LOG.info("Image downloaded from %(image_location)s "
+ "in %(totaltime)s seconds",
+ {'image_location': image_location,
+ 'totaltime': totaltime})
image_download.verify_image(image_location)
@@ -597,8 +604,8 @@ class StandbyExtension(base.BaseAgentExtension):
break
totaltime = time.time() - starttime
- LOG.info("Image streamed onto device {} in {} "
- "seconds".format(device, totaltime))
+ LOG.info("Image streamed onto device %(device)s in %(totaltime)s "
+ "seconds", {'device': device, 'totaltime': totaltime})
# Verify if the checksum of the streamed image is correct
image_download.verify_image(device)
# Fix any gpt partition
@@ -609,7 +616,8 @@ class StandbyExtension(base.BaseAgentExtension):
pass
# Fix the root partition UUID
root_uuid = disk_utils.block_uuid(device)
- LOG.info("{} UUID is now {}".format(device, root_uuid))
+ LOG.info("%(device)s UUID is now %(root_uuid)s",
+ {'device': device, 'root_uuid': root_uuid})
self.partition_uuids['root uuid'] = root_uuid
def _fix_up_partition_uuids(self, image_info, device):