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

vultr.py: query_resource_by_key Handle list and dict #43301

Merged
merged 1 commit into from
Aug 13, 2018

Conversation

Spredzy
Copy link
Contributor

@Spredzy Spredzy commented Jul 26, 2018

SUMMARY

The Vultr API is inconsistent in the type of the value it returns
based on the resources. While most of the time it will be a dict, for
some resources it will be a list (/v1/user/list, /v1/block/list).

query_resource_by_key() fails if the return value isn't a dict (.items()
does not exist on list). This patch aims to support both list and dict.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • module_utils/vultr.py
ANSIBLE VERSION
  • devel
ADDITIONAL INFORMATION
  • N/A

@ansibot
Copy link
Contributor

ansibot commented Jul 26, 2018

cc @resmo
click here for bot help

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. cloud needs_triage Needs a first human triage before being processed. owner_pr This PR is made by the module's maintainer. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jul 26, 2018
@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Jul 26, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 11, 2018
The Vultr API is inconsistent in the type of the value it returns
based on the resources. While most of the time it will be a dict, for
some resources it will be a list (/v1/user/list, /v1/block/list).

query_resource_by_key() fails if the return value isn't a dict (.items()
does not exist on list). This patch aims to support both list and dict.
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 13, 2018
Copy link
Contributor

@resmo resmo left a comment

Choose a reason for hiding this comment

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

shipit

@Spredzy
Copy link
Contributor Author

Spredzy commented Aug 13, 2018

bot_status

@ansibot
Copy link
Contributor

ansibot commented Aug 13, 2018

Components

lib/ansible/module_utils/vultr.py
support: core
maintainers: Spredzy resmo

Metadata

waiting_on: ansible
changes_requested_by: null
needs_info: False
needs_revision: False
needs_rebase: False
merge_commits: []
too many files or commits: False
mergeable_state: clean
shippable_status: success
maintainer_shipits (module maintainers): False
community_shipits (namespace maintainers): False
ansible_shipits (core team members): False
shipit_actors (maintainer or core team member): None
shipit_actors_other:
automerge: automerge shipit test failed

click here for bot help

Copy link
Contributor

@resmo resmo left a comment

Choose a reason for hiding this comment

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

shipit

@resmo resmo merged commit fd554e9 into ansible:devel Aug 13, 2018
@dagwieers dagwieers added the vultr Vultr community label Feb 11, 2019
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. cloud owner_pr This PR is made by the module's maintainer. support:core This issue/PR relates to code supported by the Ansible Engineering Team. vultr Vultr community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants