1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fix the issue#5275: iso_create doesn't add folders (#5468) (#5487)

* fix the issue

* add changelog

* add changelog file

* Update changelogs/fragments/5468-iso-create-not-add-folders.yml

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit c757e20d10)

Co-authored-by: Yuhua Zou <41054978+ZouYuhua@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2022-11-07 07:28:53 +01:00 committed by GitHub
parent 27fc80895c
commit 7e23ef3801
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- iso_create - the module somtimes failed to add folders for Joliet and UDF formats (https://github.com/ansible-collections/community.general/issues/5275).

View file

@ -188,9 +188,9 @@ def add_directory(module, iso_file=None, dir_path=None, rock_ridge=None, use_jol
if rock_ridge: if rock_ridge:
rr_name = os.path.basename(dir_path) rr_name = os.path.basename(dir_path)
if use_joliet: if use_joliet:
joliet_path = iso_dir_path joliet_path = dir_path
if use_udf: if use_udf:
udf_path = iso_dir_path udf_path = dir_path
try: try:
iso_file.add_directory(iso_path=iso_dir_path, rr_name=rr_name, joliet_path=joliet_path, udf_path=udf_path) iso_file.add_directory(iso_path=iso_dir_path, rr_name=rr_name, joliet_path=joliet_path, udf_path=udf_path)
except Exception as err: except Exception as err:
@ -254,7 +254,7 @@ def main():
udf=use_udf udf=use_udf
) )
if not module.check_mode: if not module.check_mode:
iso_file = pycdlib.PyCdlib() iso_file = pycdlib.PyCdlib(always_consistent=True)
iso_file.new(interchange_level=inter_level, vol_ident=volume_id, rock_ridge=rock_ridge, joliet=use_joliet, udf=use_udf) iso_file.new(interchange_level=inter_level, vol_ident=volume_id, rock_ridge=rock_ridge, joliet=use_joliet, udf=use_udf)
for src_file in src_file_list: for src_file in src_file_list: