ansible-collections / ibm_zos_core

Red Hat Ansible Certified Content for IBM Z
75 stars 44 forks source link

[community] [code] [connection] Investigate `*_file` functions in ssh.py for potential to add z/OS file tags #1432

Open ketankelkar opened 3 months ago

ketankelkar commented 3 months ago

The ssh connection plugin has functions put_file and fetch_file.

Determine if there's scope to handle tags for z/OS UNIX files.

The zos-util package contains python functions for checking extended file attributes, e.g.:

A potential concern may be raised that such changes will require new package imports. While true, those import(s) can be wrapped inside a conditional to even set a boolean variable is_zos_target

try:
  import zos-util
  is_zos_target: True #  import only succeeds for z/OS
except ImportException:
  is_zos_target: False

And now, function logic can leverage the is_zos_target boolean.