Fix formatting

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2020-08-20 15:09:27 +02:00
parent 40bbb4325a
commit e628bb91ec
3 changed files with 41 additions and 16 deletions

View File

@ -512,7 +512,7 @@ def prepare_iso(
else: else:
data = iso.get_graft_points( data = iso.get_graft_points(
compose.paths.compose.topdir(), compose.paths.compose.topdir(),
[iso._paths_from_list(tree_dir, split_iso_data["files"]), iso_dir] [iso._paths_from_list(tree_dir, split_iso_data["files"]), iso_dir],
) )
if compose.conf["createiso_break_hardlinks"]: if compose.conf["createiso_break_hardlinks"]:

View File

@ -199,7 +199,9 @@ def get_iso_contents(
buildinstall_dir = os.path.join(buildinstall_dir, variant.uid) buildinstall_dir = os.path.join(buildinstall_dir, variant.uid)
copy_boot_images(buildinstall_dir, iso_dir) copy_boot_images(buildinstall_dir, iso_dir)
files = iso.get_graft_points(compose.paths.compose.topdir(), [buildinstall_dir, iso_dir]) files = iso.get_graft_points(
compose.paths.compose.topdir(), [buildinstall_dir, iso_dir]
)
# We need to point efiboot.img to compose/ tree, because it was # We need to point efiboot.img to compose/ tree, because it was
# modified in buildinstall phase and the file in work/ has different # modified in buildinstall phase and the file in work/ has different
@ -215,19 +217,25 @@ def get_iso_contents(
# Get packages... # Get packages...
package_dir = compose.paths.compose.packages(arch, var) package_dir = compose.paths.compose.packages(arch, var)
for k, v in iso.get_graft_points(compose.paths.compose.topdir(), [package_dir]).items(): for k, v in iso.get_graft_points(
compose.paths.compose.topdir(), [package_dir]
).items():
files[os.path.join(var.uid, "Packages", k)] = v files[os.path.join(var.uid, "Packages", k)] = v
# Get repodata... # Get repodata...
tree_dir = compose.paths.compose.repository(arch, var) tree_dir = compose.paths.compose.repository(arch, var)
repo_dir = os.path.join(tree_dir, "repodata") repo_dir = os.path.join(tree_dir, "repodata")
for k, v in iso.get_graft_points(compose.paths.compose.topdir(), [repo_dir]).items(): for k, v in iso.get_graft_points(
compose.paths.compose.topdir(), [repo_dir]
).items():
files[os.path.join(var.uid, "repodata", k)] = v files[os.path.join(var.uid, "repodata", k)] = v
if inherit_extra_files: if inherit_extra_files:
# Get extra files... # Get extra files...
extra_files_dir = compose.paths.work.extra_files_dir(arch, var) extra_files_dir = compose.paths.work.extra_files_dir(arch, var)
for k, v in iso.get_graft_points(compose.paths.compose.topdir(), [extra_files_dir]).items(): for k, v in iso.get_graft_points(
compose.paths.compose.topdir(), [extra_files_dir]
).items():
files[os.path.join(var.uid, k)] = v files[os.path.join(var.uid, k)] = v
extra_files_dir = compose.paths.work.extra_iso_extra_files_dir(arch, variant) extra_files_dir = compose.paths.work.extra_iso_extra_files_dir(arch, variant)
@ -243,7 +251,9 @@ def get_iso_contents(
) )
# Add extra files specific for the ISO # Add extra files specific for the ISO
files.update(iso.get_graft_points(compose.paths.compose.topdir(), [extra_files_dir])) files.update(
iso.get_graft_points(compose.paths.compose.topdir(), [extra_files_dir])
)
gp = "%s-graft-points" % iso_dir gp = "%s-graft-points" % iso_dir
iso.write_graft_points(gp, files, exclude=["*/lost+found", "*/boot.iso"]) iso.write_graft_points(gp, files, exclude=["*/lost+found", "*/boot.iso"])

View File

@ -665,8 +665,12 @@ class GetIsoContentsTest(helpers.PungiTestCase):
six.assertCountEqual( six.assertCountEqual(
self, self,
ggp.call_args_list, ggp.call_args_list,
[mock.call(self.compose.paths.compose.topdir(), [
[os.path.join(self.topdir, x)]) for x in gp], mock.call(
self.compose.paths.compose.topdir(), [os.path.join(self.topdir, x)]
)
for x in gp
],
) )
self.assertEqual(len(wgp.call_args_list), 1) self.assertEqual(len(wgp.call_args_list), 1)
self.assertEqual(wgp.call_args_list[0][0][0], gp_file) self.assertEqual(wgp.call_args_list[0][0][0], gp_file)
@ -735,8 +739,12 @@ class GetIsoContentsTest(helpers.PungiTestCase):
six.assertCountEqual( six.assertCountEqual(
self, self,
ggp.call_args_list, ggp.call_args_list,
[mock.call(self.compose.paths.compose.topdir(), [
[os.path.join(self.topdir, x)]) for x in gp], mock.call(
self.compose.paths.compose.topdir(), [os.path.join(self.topdir, x)]
)
for x in gp
],
) )
self.assertEqual(len(wgp.call_args_list), 1) self.assertEqual(len(wgp.call_args_list), 1)
self.assertEqual(wgp.call_args_list[0][0][0], gp_file) self.assertEqual(wgp.call_args_list[0][0][0], gp_file)
@ -801,8 +809,12 @@ class GetIsoContentsTest(helpers.PungiTestCase):
six.assertCountEqual( six.assertCountEqual(
self, self,
ggp.call_args_list, ggp.call_args_list,
[mock.call(self.compose.paths.compose.topdir(), [
[os.path.join(self.topdir, x)]) for x in gp], mock.call(
self.compose.paths.compose.topdir(), [os.path.join(self.topdir, x)]
)
for x in gp
],
) )
self.assertEqual(len(wgp.call_args_list), 1) self.assertEqual(len(wgp.call_args_list), 1)
self.assertEqual(wgp.call_args_list[0][0][0], gp_file) self.assertEqual(wgp.call_args_list[0][0][0], gp_file)
@ -893,10 +905,13 @@ class GetIsoContentsTest(helpers.PungiTestCase):
six.assertCountEqual( six.assertCountEqual(
self, self,
ggp.call_args_list, ggp.call_args_list,
[mock.call(self.compose.paths.compose.topdir(), [
[os.path.join(self.topdir, x)]) for x in gp] mock.call(
+ [mock.call(self.compose.paths.compose.topdir(), self.compose.paths.compose.topdir(), [os.path.join(self.topdir, x)]
[bi_dir, iso_dir])], )
for x in gp
]
+ [mock.call(self.compose.paths.compose.topdir(), [bi_dir, iso_dir])],
) )
self.assertEqual(len(wgp.call_args_list), 1) self.assertEqual(len(wgp.call_args_list), 1)
self.assertEqual(wgp.call_args_list[0][0][0], gp_file) self.assertEqual(wgp.call_args_list[0][0][0], gp_file)