Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azure.azcollection.azure_rm_resourcegroup_info breaking change in 1.18 (provisioning_state) #1304

Closed
arvindshmicrosoft opened this issue Oct 29, 2023 · 4 comments
Labels
enhancement New feature or request not a bug Not a bug

Comments

@arvindshmicrosoft
Copy link

SUMMARY

In azure.azcollection version 1.18 and above, the return value of azure.azcollection.azure_rm_resourcegroup_info has a properties.provisioning_state attribute, which is named differently from the previous versions of this collection, where it was called properties.provisioningState.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

azure.azcollection.azure_rm_resourcegroup_info

ANSIBLE VERSION
ansible [core 2.15.5]
  config file = None
  configured module search path = ['/home/someuser/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/someuser/env39/lib/python3.9/site-packages/ansible
  ansible collection location = /home/someuser/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/someuser/env39/bin/ansible
  python version = 3.9.5 (default, Nov 23 2021, 15:27:38) [GCC 9.3.0] (/home/someuser/env39/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
# /home/someuser/.ansible/collections/ansible_collections
Collection         Version
------------------ -------
azure.azcollection 1.18.0
CONFIGURATION
CONFIG_FILE() = None
OS / ENVIRONMENT

Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal

STEPS TO REPRODUCE

Previously up to azure azcollection version 1.18, the azure.azcollection.azure_rm_resourcegroup_info module would return the provisioning state of the resource group under the properties section with an attribute called provisioningState:

{
                "id": "/subscriptions/SUBID/resourceGroups/MYRG",
                "location": "MYLOCATION",
                "name": "MYRG",
                "properties": {
                    "provisioningState": "Succeeded"
                },
                "tags": {},
                "type": "Microsoft.Resources/resourceGroups"
            }

In collection version 1.18 and above, that property name seems to have changed to provisioning_state. Is this expected? Also, this properties section is not documented in the help for this module. Is it safe to rely on its behavior? Can properties be documented officially?

{
                "id": "/subscriptions/SUBID/resourceGroups/MYRG",
                "location": "MYLOCATION",
                "name": "MYRG",
                "properties": {
                    "provisioning_state": "Succeeded"
                },
                "tags": {},
                "type": "Microsoft.Resources/resourceGroups"
            }
    - name: Ensure that the resource group is available
      azure.azcollection.azure_rm_resourcegroup_info:
        name: "MYRG"
      register: resource_group_facts

    - debug:
        msg: "{{  resource_group_facts }}"
EXPECTED RESULTS

I was expecting the properties.provisioningState to be available even in 1.18

ACTUAL RESULTS

The attribute is now called properties.provisioning_state in 1.18

See above

@Fred-sun
Copy link
Collaborator

Fred-sun commented Oct 30, 2023

@arvindshmicrosoft Yes, the reason is that after msrest was deprecated, it was used to use the serialiser method that came with the sdk(#1245), and its return value was changed to underscore naming instead of hump naming. We will release a new version after migrate some package!

@Fred-sun Fred-sun added bug Something isn't working enhancement New feature or request work in In trying to solve, or in working with contributors not a bug Not a bug and removed bug Something isn't working work in In trying to solve, or in working with contributors labels Oct 30, 2023
@arvindshmicrosoft
Copy link
Author

arvindshmicrosoft commented Oct 30, 2023

@arvindshmicrosoft Yes, the reason is that after msrest was deprecated, it was used to use the serialiser method that came with the sdk(#1245), and its return value was changed to underscore naming instead of hump naming. We will release a new version after migrate some package!

Thanks for the explanation! To be clear, are you saying that in the future, it will be changed back to provisioningState in Ansible?

@Fred-sun
Copy link
Collaborator

Fred-sun commented Nov 1, 2023

@arvindshmicrosoft No, Keep it like this. thank you!

@Fred-sun
Copy link
Collaborator

Fred-sun commented Nov 1, 2023

I will close it! Thank you very much!

@Fred-sun Fred-sun closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request not a bug Not a bug
Projects
None yet
Development

No branches or pull requests

2 participants