diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml index f9e4b0b78c..fc03ae82a5 100644 --- a/.github/workflows/sanity.yml +++ b/.github/workflows/sanity.yml @@ -5,68 +5,32 @@ on: [workflow_call] # allow this workflow to be called from other workflows jobs: sanity: - uses: ansible-network/github_actions/.github/workflows/sanity.yml@main + # stable-6 sanity test versions locked based on tested versions as of 7.0.0 release + uses: ansible-network/github_actions/.github/workflows/sanity.yml@b2b68168f3040e55553664b1fbcdc19cf10f49bc with: - matrix_include: "[]" + matrix_include: >- + [] + # devel and milestone are a moving target while we should fix issues in the + # main and our current major releases, they're no always appropriate to + # backport to older releases. matrix_exclude: >- - [ - { - "ansible-version": "stable-2.9" - }, - { - "ansible-version": "stable-2.12", - "python-version": "3.7" - }, - { - "ansible-version": "stable-2.12", - "python-version": "3.11" - }, - { - "ansible-version": "stable-2.13", - "python-version": "3.7" - }, - { - "ansible-version": "stable-2.13", - "python-version": "3.11" - }, - { - "ansible-version": "stable-2.14", - "python-version": "3.7" - }, - { - "ansible-version": "stable-2.14", - "python-version": "3.8" - }, - { - "ansible-version": "stable-2.15", - "python-version": "3.7" - }, - { - "ansible-version": "stable-2.15", - "python-version": "3.8" - }, - { - "ansible-version": "milestone", - "python-version": "3.7" - }, - { - "ansible-version": "milestone", - "python-version": "3.8" - }, - { - "ansible-version": "milestone", - "python-version": "3.9" - }, - { - "ansible-version": "devel", - "python-version": "3.7" - }, - { - "ansible-version": "devel", - "python-version": "3.8" - }, - { - "ansible-version": "devel", - "python-version": "3.9" - } - ] + [ + { + "ansible-version": "milestone" + }, + { + "ansible-version": "devel" + }, + { + "ansible-version": "stable-2.14", + "python-version": "3.12" + }, + { + "ansible-version": "stable-2.15", + "python-version": "3.12" + }, + { + "ansible-version": "stable-2.16", + "python-version": "3.9" + } + ] diff --git a/.github/workflows/units.yml b/.github/workflows/units.yml index d05d8c1029..5ba7a54d93 100644 --- a/.github/workflows/units.yml +++ b/.github/workflows/units.yml @@ -5,4 +5,28 @@ on: [workflow_call] # allow this workflow to be called from other workflows jobs: unit-source: - uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main + # stable-6 unit test versions locked based on tested versions as of 7.0.0 release + uses: ansible-network/github_actions/.github/workflows/unit_source.yml@b2b68168f3040e55553664b1fbcdc19cf10f49bc + with: + # devel and milestone are a moving target while we should fix issues in the + # main and our current major releases, they're no always appropriate to + # backport to older releases. + matrix_exclude: >- + [ + { + "ansible-version": "milestone" + }, + { + "ansible-version": "devel" + }, + { + "python-version": "3.11" + }, + { + "python-version": "3.12" + }, + { + "ansible-version": "stable-2.16", + "python-version": "3.9" + } + ] diff --git a/plugins/modules/autoscaling_group.py b/plugins/modules/autoscaling_group.py index 56389400b2..70c5075883 100644 --- a/plugins/modules/autoscaling_group.py +++ b/plugins/modules/autoscaling_group.py @@ -1675,15 +1675,15 @@ def get_instances_by_launch_config(props, lc_check, initial_instances): old_instances.append(i) else: - module.debug(f"Comparing initial instances with current: {*initial_instances,}") + module.debug(f"Comparing initial instances with current: {*initial_instances, }") for i in props["instances"]: if i not in initial_instances: new_instances.append(i) else: old_instances.append(i) - module.debug(f"New instances: {len(new_instances)}, {*new_instances,}") - module.debug(f"Old instances: {len(old_instances)}, {*old_instances,}") + module.debug(f"New instances: {len(new_instances)}, {*new_instances, }") + module.debug(f"Old instances: {len(old_instances)}, {*old_instances, }") return new_instances, old_instances @@ -1702,15 +1702,15 @@ def get_instances_by_launch_template(props, lt_check, initial_instances): else: old_instances.append(i) else: - module.debug(f"Comparing initial instances with current: {*initial_instances,}") + module.debug(f"Comparing initial instances with current: {*initial_instances, }") for i in props["instances"]: if i not in initial_instances: new_instances.append(i) else: old_instances.append(i) - module.debug(f"New instances: {len(new_instances)}, {*new_instances,}") - module.debug(f"Old instances: {len(old_instances)}, {*old_instances,}") + module.debug(f"New instances: {len(new_instances)}, {*new_instances, }") + module.debug(f"Old instances: {len(old_instances)}, {*old_instances, }") return new_instances, old_instances @@ -1775,9 +1775,9 @@ def terminate_batch(connection, replace_instances, initial_instances, leftovers= instances_to_terminate = list_purgeable_instances(props, lc_check, lt_check, replace_instances, initial_instances) module.debug(f"new instances needed: {num_new_inst_needed}") - module.debug(f"new instances: {*new_instances,}") - module.debug(f"old instances: {*old_instances,}") - module.debug(f"batch instances: {*instances_to_terminate,}") + module.debug(f"new instances: {*new_instances, }") + module.debug(f"old instances: {*old_instances, }") + module.debug(f"batch instances: {*instances_to_terminate, }") if num_new_inst_needed == 0: decrement_capacity = True diff --git a/plugins/modules/rds_instance_snapshot.py b/plugins/modules/rds_instance_snapshot.py index 8aa5c34fa9..210a64b96a 100644 --- a/plugins/modules/rds_instance_snapshot.py +++ b/plugins/modules/rds_instance_snapshot.py @@ -268,7 +268,7 @@ def get_parameters(parameters, method_name): required_options = get_boto3_client_method_parameters(client, method_name, required=True) if any(parameters.get(k) is None for k in required_options): method_description = get_rds_method_attribute(method_name, module).operation_description - module.fail_json(msg=f"To {method_description} requires the parameters: {*required_options,}") + module.fail_json(msg=f"To {method_description} requires the parameters: {*required_options, }") options = get_boto3_client_method_parameters(client, method_name) parameters = dict((k, v) for k, v in parameters.items() if k in options and v is not None) diff --git a/tests/unit/plugins/modules/test_ec2_ami_info.py b/tests/unit/plugins/modules/test_ec2_ami_info.py index 797e29004a..d2f94bc48c 100644 --- a/tests/unit/plugins/modules/test_ec2_ami_info.py +++ b/tests/unit/plugins/modules/test_ec2_ami_info.py @@ -198,7 +198,7 @@ def test_list_ec2_images(m_get_images, m_get_image_attribute): m_get_images.assert_called_with(ec2_client, request_args) assert m_get_image_attribute.call_count == 2 - assert m_get_image_attribute.has_calls([call(ec2_client, images[0])], [call(ec2_client, images[1])]) + assert m_get_image_attribute.has_called_with([call(ec2_client, images[0]), call(ec2_client, images[1])]) assert len(list_ec2_images_result) == 2 assert list_ec2_images_result[0]["image_id"] == "ami-1234567890"