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

fix a typo error. related to #757 #769

Merged
merged 2 commits into from
Mar 4, 2022
Merged

Conversation

danielino
Copy link
Contributor

@danielino danielino commented Feb 22, 2022

SUMMARY

there is an issue with MSI Authentication.

Fixes #757

Loading collection azure.azcollection from /home/jenkins/.ansible/collections/ansible_collections/azure/azcollection

# credential object dumped:
{'credentials': <msrestazure.azure_active_directory.MSIAuthentication object at 0x7f1f38d64c40>, 'subscription_id': 'XYZ-EDITED-XXYZ'}

[WARNING]:  * Failed to parse /work/env.azure_rm.yml with ansible_collections.azure.azcollection.plugins.inventory.azure_rm plugin: 'credential'
  File "/home/jenkins/.local/lib/python3.9/site-packages/ansible/inventory/manager.py", line 290, in parse_source
    plugin.parse(self._inventory, self._loader, source, cache=cache)
  File "/home/jenkins/.ansible/collections/ansible_collections/azure/azcollection/plugins/inventory/azure_rm.py", line 219, in parse
    self._credential_setup()
  File "/home/jenkins/.ansible/collections/ansible_collections/azure/azcollection/plugins/inventory/azure_rm.py", line 240, in _credential_setup
    self.azure_auth = AzureRMAuth(**auth_options)
  File "/home/jenkins/.ansible/collections/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py", line 1513, in __init__

# root cause of the issue 
    self.azure_credential_track2 = self.credentials['credential']
[WARNING]: Unable to parse /work/env.azure_rm.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

azurerm inventory plugin

@Fred-sun

This comment was marked as resolved.

@Fred-sun Fred-sun added hold The problem holds for a particular reason medium_priority Medium priority work in In trying to solve, or in working with contributors and removed hold The problem holds for a particular reason labels Feb 27, 2022
@Fred-sun
Copy link
Collaborator

Fred-sun commented Mar 1, 2022

@danielino Thank you for your contribution, your description is reasonable, I will promote the merger as soon as possible!

@Fred-sun
Copy link
Collaborator

Fred-sun commented Mar 1, 2022

@danielino You can also delete the following line from the PR because "credential" is not being referenced. Thank you very much!

'credential': credentials,

@Fred-sun Fred-sun added ready_for_review The PR has been modified and can be reviewed and merged and removed work in In trying to solve, or in working with contributors labels Mar 1, 2022
@danielino
Copy link
Contributor Author

ok, i have removed the line 1619. thank you

@xuzhang3 xuzhang3 merged commit 9ae26a6 into ansible-collections:dev Mar 4, 2022
Fred-sun added a commit to Fred-sun/ansible_collections_azure that referenced this pull request Mar 8, 2022
* azure_rm_sqldatabase: parse datetime module arguments (ansible-collections#623)

* rm_sqldatabase: parse datetime arguments

* Remove unused sanity test exception on rm_sqldatabase module schema

* Remove unused sanity test exception on rm_sqldatabase module schema bis

* sqldatabase: import dateutil in try/except

* Add dateutil install to test suite

* sqldatabase_info: Add earliest_restore_date value to returned facts

* sqldatabase: add point in time restore test

* Conditionally call non MSI auth when interacting with keyvault (ansible-collections#770)

* Added the VM status detection mechanism (ansible-collections#772)

* Set the parameter to a random number

* Update storage account name

Update azure_rm_virtualmachine vars

add new change

add new change 02

add new change 03

add new change 05

add new change 06

add new change 08

add new change09

update new

Update new 02

Improve code logic

* fix a typo error. related to ansible-collections#757 (ansible-collections#769)

* fix a typo error. related to ansible-collections#757

* remove unused line

Co-authored-by: Daniele Marcocci <daniele.marcocci@outlook.com>

* Update test region (ansible-collections#776)

Co-authored-by: Max <max@23.tf>
Co-authored-by: Daniele Marcocci <danielinor0x@hotmail.com>
Co-authored-by: Daniele Marcocci <daniele.marcocci@outlook.com>
xuzhang3 pushed a commit that referenced this pull request Mar 8, 2022
* Ugrade azure-mgmt-compute SDK to track2

* fix small

* Modify version from v2021-07-01 to v2020-04-01, no disk encryptions operation

* Update small

* fix azure_rm_diskencryption test fail

* fix azure_rm_diskencryption test fail02

* fix sanity error

* fix azure_rm_diskcryptionset test fail

* fix azure_rm_virtualmachinescalesetinstance_info bug

* fix azure_rm_virtualmachinescalesetinstance_info bug 02

* fix azure_rm_virtualmachien*extension test fail

* Update azure_rm_virtualmachinescalesetinstance func paramter to vm_instance_i_ds

* fix azure_rm_virtualmachinescalesetinstance test fail

* fix sanity test fail

* change exception type

* fix azure_rm_hostgroup module

* Update the code that throws the exception

* Merge dev to local branch (#10)

* azure_rm_sqldatabase: parse datetime module arguments (#623)

* rm_sqldatabase: parse datetime arguments

* Remove unused sanity test exception on rm_sqldatabase module schema

* Remove unused sanity test exception on rm_sqldatabase module schema bis

* sqldatabase: import dateutil in try/except

* Add dateutil install to test suite

* sqldatabase_info: Add earliest_restore_date value to returned facts

* sqldatabase: add point in time restore test

* Conditionally call non MSI auth when interacting with keyvault (#770)

* Added the VM status detection mechanism (#772)

* Set the parameter to a random number

* Update storage account name

Update azure_rm_virtualmachine vars

add new change

add new change 02

add new change 03

add new change 05

add new change 06

add new change 08

add new change09

update new

Update new 02

Improve code logic

* fix a typo error. related to #757 (#769)

* fix a typo error. related to #757

* remove unused line

Co-authored-by: Daniele Marcocci <daniele.marcocci@outlook.com>

* Update test region (#776)

Co-authored-by: Max <max@23.tf>
Co-authored-by: Daniele Marcocci <danielinor0x@hotmail.com>
Co-authored-by: Daniele Marcocci <daniele.marcocci@outlook.com>

* Revert "Merge dev to local branch (#10)" (#11)

This reverts commit 1dce8f3.

Co-authored-by: Max <max@23.tf>
Co-authored-by: Daniele Marcocci <danielinor0x@hotmail.com>
Co-authored-by: Daniele Marcocci <daniele.marcocci@outlook.com>
Copy link

@djcldcvr djcldcvr left a comment

Choose a reason for hiding this comment

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

Getting following error while running playbook with ansible version ansible "2.10.17", azure.azcollection "1.12.0" & community.general "4.6.1" !!

TypeError: init() got an unexpected keyword argument 'credential'

@Fred-sun
Copy link
Collaborator

@djcldcvr Could you please help to provide detailed logs? We tested this rigorously when we upgraded the SDK. Is it possible that you have updated the azcollection version, but the dependency has not been updated. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority ready_for_review The PR has been modified and can be reviewed and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Managed Identity auth_source: msi no longer works with collection 1.11, returns KeyError: 'credential'
4 participants