Skip to content

Commit

Permalink
[Sanity] [module_utils/encode] Sanity error failing with 2.18 (#1865)
Browse files Browse the repository at this point in the history
* Added encode fix

* Added changelogs

* Fixed users utility
  • Loading branch information
fernandofloresg authored and Rohitcodes28 committed Jan 23, 2025
1 parent 3d65a56 commit f1ac094
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/1865-fix-sanity-2.18-encode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
trivial:
- module_utils/encode.py - Fixed sanity error using variable 'dest_f' before assignment.
(https://github.com/ansible-collections/ibm_zos_core/pull/1865).
2 changes: 2 additions & 0 deletions plugins/module_utils/encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ def uss_convert_encoding_prev(self, src, dest, from_code, to_code):
"Directory {0} is empty. Please check the path.".format(src)
)
elif len(file_list) == 1:
dest_f = dest
src_f = src
if path.isdir(dest):
file_name = path.basename(file_list[0])
src_f = path.join(validation.validate_safe_path(src), validation.validate_safe_path(file_name))
Expand Down

0 comments on commit f1ac094

Please sign in to comment.