Skip to content

Conversation

AndreMarcel99
Copy link
Collaborator

@AndreMarcel99 AndreMarcel99 commented Oct 3, 2025

SUMMARY

This is part of the task #2294 to ensure all is aligned and add the deprecation messages for 2.0.0 version.

ISSUE TYPE
  • Enabler Pull Request
COMPONENT NAME

Add module.deprecate or display.deprecate to ensure message as warning for arguments that will be deprecated or pass to be aliases on the 2.0.0 version of the collection.

ADDITIONAL INFORMATION

To see the full deprecation warning required the task to be complete or exit with a module.fail_json, other kind of error won't generate deprecation warnings.

Not all new name names could be use as aliases because generate match problems with other parameters such type on zos_archive and zos_unarchive. force option for zos_copy.

Playbook to test

- hosts: zvm
  collections:
    - ibm.ibm_zos_core
  gather_facts: False
  vars:
    ZOAU: "/zoau/v1.3.5.1"
    PYZ: "/allpython/3.12/usr/lpp/IBM/cyp/v3r12/pyz"
  environment: "{{ environment_vars }}"
  tasks:
    - name: Show the warning error messages on every module
      block:

        - name: Create dataset to backup
          zos_data_set:
            name: DATASET.TO.TEST
            type: seq
            state: present

        - name: Create dataset to backup
          zos_data_set:
            name: DATASET.TO.TEST.TWO
            type: seq
            state: present

        - name: See deprecation warning zos_apf
          zos_apf:
            library: SOME.SEQUENTIAL.DATASET
            force_dynamic: true
            persistent:
              data_set_name: SOME.PARTITIONED.DATASET(MEM)
          ignore_errors: true

        - name: See deprecation warning zos_archive
          zos_archive:
            src: "DATASET.TO.TEST"
            dest: "DATASET.TO.TEST.TWO"
            format:
              name: terse
              format_options:
                terse_pack: spack
                use_adrdssu: true
          check_mode: true 
          ignore_errors: true

        - name: See deprecation warning zos_copy
          zos_copy:
            src: "DATASET.TO.TEST"
            dest: "DATASET.TO.TEST.TWO"
            remote_src: true
            force: true
            force_lock: true
            is_binary: true
          ignore_errors: true

        - name: See deprecation warning zos_fetch
          zos_fetch:
            src: DATASET.TO.TEST.TWO
            dest: /tmp/fetched
            is_binary: true
            flat: true
          ignore_errors: true

        - name: See deprecation warning zos_find
          zos_find:
            patterns: '^te.*'
            pds_patterns:
              - IMSTEST.TEST.*
              - IMSTEST.USER.*
              - USER.*.LIB

        - name: See deprecation warning zos_job_output
          zos_job_output:
            job_id: "STC02560"
            ddname: "JESMSGLG"
          ignore_errors: true

        - name: See deprecation warning zos_job_submit
          zos_job_submit:
            src: "DATASET.TO.TEST.TWO"
            wait_time_s: 5
            location: data_set
          ignore_errors: true

        - name: See derpecation warning zos_mount
          zos_mount:
            src: SOMEUSER.VVV.ZFS
            path: /u/omvsadm/core
            fs_type: zfs
            state: mounted
            persistent:
              data_store: "DATASET.TO.TEST.TWO"
              comment: For Tape2 project
          ignore_errors: true

        - name: See deprecation warnings zos_operator
          zos_operator:
            cmd: 'd a,all'
            wait_time_s: 5
          ignore_errors: true

        - name: See deprecation warnings zos_operator_action_query
          zos_operator_action_query:
              job_name: mq*
              message_id: dsi*
              system: mv29
              message_filter:
                  filter: ^.*IMS.*$
                  use_regex: true
          ignore_errors: true

        - name: See deprecation warnings zos_unarchive
          zos_unarchive:
            src: "USER.OUTPUT.TERSE"
            remote_src: true
            format:
              name: terse
              format_options:
                use_adrdssu: true
          ignore_errors: true

      always:
        - name: Delete dataset
          zos_data_set:
            name: "DATASET.TO.TEST"
            state: absent

        - name: Delete dataset
          zos_data_set:
            name: "DATASET.TO.TEST.TWO"
            state: absent

@AndreMarcel99 AndreMarcel99 changed the base branch from dev to staging-v1.16.0-beta.1 October 3, 2025 00:47
@AndreMarcel99 AndreMarcel99 changed the title Enabler/2294/add aliases and deprecation messages [Enabler][2294]Add_aliases_and_deprecation_messages_for_new_version Oct 6, 2025

if pds_paths is not None:
module.deprecate(
msg="The 'pds_pattern' parameter and aliases is deprecated and will be removed. Onnew version to serach for an specific member required regex isnide ()",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo? Onnew? The sentence is confusing as it stands.


if ddname is not None:
module.deprecate(
msg="The 'ddname' parameter is deprecated and will be use as alias. Please use 'dd_name' instead.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use -> used


if module.params.get("location") is not None:
module.deprecate(
msg="The 'location' parameter will be drpecated Please use 'remote_src' instead. Logic will change to set if the document with the job is" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drpecated -> deprecated


if module.params.get('wait_time_s') is not None:
module.deprecate(
msg="The 'wait_time_s' parameter will be deprecated. Please use 'wait_time' instead. And option 'time_unit' will be added to set cs o seconds.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Third sentence should not start with 'And", and I'm confused by the words after 'set' in that sentence.

if module.params.get('message_filter') is not None:
if module.params.get('message_filter').get('use_regex') is not None:
module.deprecate(
msg="The 'use_regex' parameter will be deprecated. Please use 'literal' instead. On new version will work on reverse logic being False to use as regex.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider at the end: "New version will use false to mean regex will be used".


if format_param.get('name') is not None:
module.deprecate(
msg="The 'format.name' parameter will be deperecated. On 2.0.0 version use 'format.type' instead.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have read a lot of messages, but this is the first time I've seen a version number. Maybe switch to "Please use...", like you do elsewhere.

@AndreMarcel99 AndreMarcel99 requested a review from richp405 October 7, 2025 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants