Merge "Add more info level logs to disk_utils.work_on_disk() method"

This commit is contained in:
Jenkins 2015-10-05 18:29:48 +00:00 committed by Gerrit Code Review
commit ed6e0952f7

@ -35,6 +35,7 @@ from ironic_lib.openstack.common import imageutils
from ironic_lib.common.i18n import _
from ironic_lib.common.i18n import _LE
from ironic_lib.common.i18n import _LI
from ironic_lib.common.i18n import _LW
from ironic_lib import disk_partitioner
from ironic_lib import exception
@ -327,6 +328,8 @@ def destroy_disk_metadata(dev, node_uuid):
{'node': node_uuid,
'command': err.cmd,
'error': err.stderr})
LOG.info(_LI("Disk metadata on %(dev)s successfully destroyed for node "
"%(node)s"), {'dev': dev, 'node': node_uuid})
def _get_configdrive(configdrive, node_uuid):
@ -438,6 +441,9 @@ def work_on_disk(dev, root_mb, swap_mb, ephemeral_mb, ephemeral_format,
commit=commit,
boot_option=boot_option,
boot_mode=boot_mode)
LOG.info(_LI("Successfully completed the disk device"
" %(dev)s partitioning for node %(node)s"),
{'dev': dev, "node": node_uuid})
ephemeral_part = part_dict.get('ephemeral')
swap_part = part_dict.get('swap')
@ -468,6 +474,9 @@ def work_on_disk(dev, root_mb, swap_mb, ephemeral_mb, ephemeral_format,
if configdrive_part:
# Copy the configdrive content to the configdrive partition
dd(configdrive_file, configdrive_part)
LOG.info(_LI("Configdrive for node %(node)s successfully copied "
"onto partition %(partition)s"),
{'node': node_uuid, 'partition': configdrive_part})
finally:
# If the configdrive was requested make sure we delete the file
@ -476,12 +485,20 @@ def work_on_disk(dev, root_mb, swap_mb, ephemeral_mb, ephemeral_format,
utils.unlink_without_raise(configdrive_file)
populate_image(image_path, root_part)
LOG.info(_LI("Image for %(node)s successfully populated"),
{'node': node_uuid})
if swap_part:
mkfs(dev=swap_part, fs='swap', label='swap1')
LOG.info(_LI("Swap partition %(swap)s successfully formatted "
"for node %(node)s"),
{'swap': swap_part, 'node': node_uuid})
if ephemeral_part and not preserve_ephemeral:
mkfs(dev=ephemeral_part, fs=ephemeral_format, label="ephemeral0")
LOG.info(_LI("Ephemeral partition %(ephemeral)s successfully "
"formatted for node %(node)s"),
{'ephemeral': ephemeral_part, 'node': node_uuid})
uuids_to_return = {
'root uuid': root_part,