diff --git a/changelogs/fragments/5468-iso-create-not-add-folders.yml b/changelogs/fragments/5468-iso-create-not-add-folders.yml new file mode 100644 index 0000000000..5bbe48f579 --- /dev/null +++ b/changelogs/fragments/5468-iso-create-not-add-folders.yml @@ -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). diff --git a/plugins/modules/files/iso_create.py b/plugins/modules/files/iso_create.py index d729f222a2..c457f5a412 100644 --- a/plugins/modules/files/iso_create.py +++ b/plugins/modules/files/iso_create.py @@ -188,9 +188,9 @@ def add_directory(module, iso_file=None, dir_path=None, rock_ridge=None, use_jol if rock_ridge: rr_name = os.path.basename(dir_path) if use_joliet: - joliet_path = iso_dir_path + joliet_path = dir_path if use_udf: - udf_path = iso_dir_path + udf_path = dir_path try: 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: @@ -254,7 +254,7 @@ def main(): udf=use_udf ) 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) for src_file in src_file_list: