ostree-installer: Use ostree as type in filename
Instead of overloading the `dvd` value, use new value `ostree` that can be overridden by a config change. Fixes: https://pagure.io/pungi/issue/418 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
8880b1ea8a
commit
cc559b12f4
@ -246,6 +246,7 @@ There a couple common format specifiers available for both the options:
|
|||||||
* ``boot`` -- for ``boot.iso`` images created in *buildinstall* phase
|
* ``boot`` -- for ``boot.iso`` images created in *buildinstall* phase
|
||||||
* ``live`` -- for images created by *live_images* phase
|
* ``live`` -- for images created by *live_images* phase
|
||||||
* ``dvd`` -- for images created by *createiso* phase
|
* ``dvd`` -- for images created by *createiso* phase
|
||||||
|
* ``ostree`` -- for ostree installer images
|
||||||
|
|
||||||
Default values are the same as the keys.
|
Default values are the same as the keys.
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class OstreeInstallerThread(WorkerThread):
|
|||||||
|
|
||||||
self._run_ostree_cmd(compose, variant, arch, config, source_repo, output_dir)
|
self._run_ostree_cmd(compose, variant, arch, config, source_repo, output_dir)
|
||||||
|
|
||||||
disc_type = compose.conf['disc_types'].get('dvd', 'dvd')
|
disc_type = compose.conf['disc_types'].get('ostree', 'ostree')
|
||||||
filename = compose.get_image_name(arch, variant, disc_type=disc_type)
|
filename = compose.get_image_name(arch, variant, disc_type=disc_type)
|
||||||
self._copy_image(compose, variant, arch, filename, output_dir)
|
self._copy_image(compose, variant, arch, filename, output_dir)
|
||||||
self._add_to_manifest(compose, variant, arch, filename)
|
self._add_to_manifest(compose, variant, arch, filename)
|
||||||
|
@ -118,7 +118,7 @@ class OstreeThreadTest(helpers.PungiTestCase):
|
|||||||
self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)])
|
self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)])
|
||||||
self.assertImageAdded(compose, ImageCls, IsoWrapper)
|
self.assertImageAdded(compose, ImageCls, IsoWrapper)
|
||||||
self.assertEqual(compose.get_image_name.call_args_list,
|
self.assertEqual(compose.get_image_name.call_args_list,
|
||||||
[mock.call('x86_64', compose.variants['Everything'], disc_type='dvd')])
|
[mock.call('x86_64', compose.variants['Everything'], disc_type='ostree')])
|
||||||
self.assertTrue(os.path.isdir(self.topdir + '/work/x86_64/Everything/'))
|
self.assertTrue(os.path.isdir(self.topdir + '/work/x86_64/Everything/'))
|
||||||
self.assertFalse(os.path.isdir(self.topdir + '/work/x86_64/Everything/ostree_installer'))
|
self.assertFalse(os.path.isdir(self.topdir + '/work/x86_64/Everything/ostree_installer'))
|
||||||
self.assertEqual(run.call_args_list,
|
self.assertEqual(run.call_args_list,
|
||||||
@ -182,7 +182,7 @@ class OstreeThreadTest(helpers.PungiTestCase):
|
|||||||
self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)])
|
self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)])
|
||||||
self.assertImageAdded(compose, ImageCls, IsoWrapper)
|
self.assertImageAdded(compose, ImageCls, IsoWrapper)
|
||||||
self.assertEqual(compose.get_image_name.call_args_list,
|
self.assertEqual(compose.get_image_name.call_args_list,
|
||||||
[mock.call('x86_64', compose.variants['Everything'], disc_type='dvd')])
|
[mock.call('x86_64', compose.variants['Everything'], disc_type='ostree')])
|
||||||
self.assertTrue(os.path.isdir(self.topdir + '/work/x86_64/Everything/'))
|
self.assertTrue(os.path.isdir(self.topdir + '/work/x86_64/Everything/'))
|
||||||
self.assertFalse(os.path.isdir(self.topdir + '/work/x86_64/Everything/ostree_installer'))
|
self.assertFalse(os.path.isdir(self.topdir + '/work/x86_64/Everything/ostree_installer'))
|
||||||
self.assertEqual(run.call_args_list,
|
self.assertEqual(run.call_args_list,
|
||||||
@ -297,7 +297,7 @@ class OstreeThreadTest(helpers.PungiTestCase):
|
|||||||
self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)])
|
self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)])
|
||||||
self.assertImageAdded(compose, ImageCls, IsoWrapper)
|
self.assertImageAdded(compose, ImageCls, IsoWrapper)
|
||||||
self.assertEqual(compose.get_image_name.call_args_list,
|
self.assertEqual(compose.get_image_name.call_args_list,
|
||||||
[mock.call('x86_64', compose.variants['Everything'], disc_type='dvd')])
|
[mock.call('x86_64', compose.variants['Everything'], disc_type='ostree')])
|
||||||
self.assertTrue(os.path.isdir(self.topdir + '/work/x86_64/Everything/'))
|
self.assertTrue(os.path.isdir(self.topdir + '/work/x86_64/Everything/'))
|
||||||
self.assertFalse(os.path.isdir(self.topdir + '/work/x86_64/Everything/ostree_installer'))
|
self.assertFalse(os.path.isdir(self.topdir + '/work/x86_64/Everything/ostree_installer'))
|
||||||
self.assertEqual(run.call_args_list,
|
self.assertEqual(run.call_args_list,
|
||||||
@ -381,7 +381,7 @@ class OstreeThreadTest(helpers.PungiTestCase):
|
|||||||
self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)])
|
self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)])
|
||||||
self.assertImageAdded(compose, ImageCls, IsoWrapper)
|
self.assertImageAdded(compose, ImageCls, IsoWrapper)
|
||||||
self.assertEqual(compose.get_image_name.call_args_list,
|
self.assertEqual(compose.get_image_name.call_args_list,
|
||||||
[mock.call('x86_64', compose.variants['Everything'], disc_type='dvd')])
|
[mock.call('x86_64', compose.variants['Everything'], disc_type='ostree')])
|
||||||
|
|
||||||
@mock.patch('kobo.shortcuts.run')
|
@mock.patch('kobo.shortcuts.run')
|
||||||
@mock.patch('productmd.images.Image')
|
@mock.patch('productmd.images.Image')
|
||||||
|
Loading…
Reference in New Issue
Block a user