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

New module: digital_ocean_region_facts #35911

Merged
merged 1 commit into from Feb 27, 2018

Conversation

Akasurde
Copy link
Member

@Akasurde Akasurde commented Feb 8, 2018

SUMMARY

Signed-off-by: Abhijeet Kasurde akasurde@redhat.com

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

lib/ansible/modules/cloud/digital_ocean/digital_ocean_region_facts.py

ANSIBLE VERSION
2.5devel

@ansibot
Copy link
Contributor

ansibot commented Feb 8, 2018

@ansibot ansibot added cloud core_review In order to be merged, this PR must follow the core review workflow. digital_ocean module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_module This PR includes a new module. new_plugin This PR includes a new plugin. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Feb 8, 2018
@Akasurde Akasurde removed the needs_triage Needs a first human triage before being processed. label Feb 9, 2018
@Akasurde
Copy link
Member Author

@pmarques Could you please review this ?

@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Feb 16, 2018
@BondAnthony
Copy link
Contributor

BondAnthony commented Feb 17, 2018

LGTM

Tested module with Ansible version 2.6

@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 Feb 17, 2018
Copy link
Contributor

@pmarques pmarques left a comment

Choose a reason for hiding this comment

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

Some comments inline

author: "Abhijeet Kasurde (@akasurde)"
version_added: "2.5"
options:
oauth_token:
Copy link
Contributor

Choose a reason for hiding this comment

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

Use documentation fragment

Copy link
Member Author

Choose a reason for hiding this comment

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

OK.

description: DigitalOcean regions facts
returned: success
type: list
sample: [
Copy link
Contributor

Choose a reason for hiding this comment

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

change to data

# Check if api_token is valid or not
response = rest.get('account')
if response.status_code == 401:
module.fail_json(msg='Failed to login using API token, please verify validity of API token.')
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this because is already inside DO utils

Copy link
Member Author

Choose a reason for hiding this comment

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

ok.

break
page += 1
regions.extend(response.json["regions"])
has_next = "pages" in response.json["links"] and "next" in response.json["links"]["pages"]
Copy link
Contributor

Choose a reason for hiding this comment

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

If PR #36004 is merged, can we update this to use get_paginated_data?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. This is old module. And 36004 got merged before this. I will update rest of them to use pagination.

def main():
module = AnsibleModule(
argument_spec=dict(
oauth_token=dict(aliases=['DO_API_TOKEN', 'DO_API_KEY', 'DO_OAUTH_TOKEN'],
Copy link
Contributor

Choose a reason for hiding this comment

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

Use digital_ocean_argument_spec form DO utils.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK.

@ansibot
Copy link
Contributor

ansibot commented Feb 26, 2018

@ansibot ansibot added test This PR relates to tests. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Feb 26, 2018
@ansibot ansibot removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Feb 26, 2018
@ansibot
Copy link
Contributor

ansibot commented Feb 26, 2018

@BondAnthony @Akasurde @alukovenko @harneksidhu @kontrafiktion @mgregson @pmarques @zbal

As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add shipit if you would like to see it merged.

click here for bot help

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Feb 26, 2018
@BondAnthony
Copy link
Contributor

LTGM

Thanks @Akasurde

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
@Akasurde Akasurde merged commit 443327f into ansible:devel Feb 27, 2018
@Akasurde Akasurde deleted the do_region_facts branch February 27, 2018 13:54
@Akasurde
Copy link
Member Author

@BondAnthony @pmarques Thanks for review.

@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cloud community_review In order to be merged, this PR must follow the community review workflow. digital_ocean module This issue/PR relates to a module. new_module This PR includes a new module. new_plugin This PR includes a new plugin. support:community This issue/PR relates to code supported by the Ansible community. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants