Merge "Add label to virtual floppy image"

This commit is contained in:
Jenkins 2015-03-11 11:43:22 +00:00 committed by Gerrit Code Review
commit 00dfc4c5c3
2 changed files with 6 additions and 2 deletions

View File

@ -112,7 +112,10 @@ def create_vfat_image(output_file, files_info=None, parameters=None,
with utils.tempdir() as tmpdir:
try:
utils.mkfs('vfat', output_file)
# The label helps ramdisks to find the partition containing
# the parameters (by using /dev/disk/by-label/ir-vfd-dev).
# NOTE: FAT filesystem label can be up to 11 characters long.
utils.mkfs('vfat', output_file, label="ir-vfd-dev")
utils.mount(output_file, tmpdir, '-o', 'umask=0')
except processutils.ProcessExecutionError as e:
raise exception.ImageCreationFailed(image_type='vfat', error=e)

View File

@ -270,7 +270,8 @@ class FsImageTestCase(base.TestCase):
'count=1',
'bs=1000KiB')
mkfs_mock.assert_called_once_with('vfat', 'tgt_file')
mkfs_mock.assert_called_once_with('vfat', 'tgt_file',
label="ir-vfd-dev")
mount_mock.assert_called_once_with('tgt_file', 'tempdir',
'-o', 'umask=0')