Skip to content

Commit

Permalink
Added tmp_dir attribute definition to class
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandofloresg committed Oct 3, 2024
1 parent eddf9ac commit b18455d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/action/zos_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def run(self, tmp=None, task_vars=None):
is_src_dir = False
temp_path = is_uss = None

self.tmp_dir = None

if dest:
if not isinstance(dest, string_types):
msg = "Invalid type supplied for 'dest' option, it must be a string"
Expand Down Expand Up @@ -268,8 +270,9 @@ def run(self, tmp=None, task_vars=None):
if template_dir:
shutil.rmtree(template_dir, ignore_errors=True)
# Remove temporary directory from remote
path = os.path.normpath(f"{self.tmp_dir}/ansible-zos-copy")
self._connection.exec_command(f"rm -rf {path}*")
if self.tmp_dir is not None:
path = os.path.normpath(f"{self.tmp_dir}/ansible-zos-copy")
self._connection.exec_command(f"rm -rf {path}*")

if copy_res.get("note") and not force:
result["note"] = copy_res.get("note")
Expand Down

0 comments on commit b18455d

Please sign in to comment.