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

s3_bucket: don't always call policy/requestPayment/versioning API #46746

Merged
merged 1 commit into from Nov 1, 2018

Conversation

pilou-
Copy link
Contributor

@pilou- pilou- commented Oct 10, 2018

SUMMARY

don't call policy/requestPayment/versioning API when default value is used with parameters policy/requester_pays/versioning.

Fix the following error:

The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_s3_bucket_payload_tfn8z6cy/__main__.py", line 181, in create_or_update_bucket
    requester_pays_status = get_bucket_request_payment(s3_client, name)
  File "/tmp/ansible_s3_bucket_payload_tfn8z6cy/ansible_s3_bucket_payload.zip/ansible/module_utils/cloud.py", line 150, in retry_func
    raise e
  File "/tmp/ansible_s3_bucket_payload_tfn8z6cy/ansible_s3_bucket_payload.zip/ansible/module_utils/cloud.py", line 140, in retry_func
    return f(*args, **kwargs)
  File "/tmp/ansible_s3_bucket_payload_tfn8z6cy/__main__.py", line 314, in get_bucket_request_payment
    return s3_client.get_bucket_request_payment(Bucket=bucket_name).get('Payer')
  File "$HOME/.venv/ansible/lib/python3.6/site-packages/botocore/client.py", line 310, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "$HOME/.venv/ansible/lib/python3.6/site-packages/botocore/client.py", line 599, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (NotImplemented) when calling the GetBucketRequestPayment operation: The requested resource is not implemented
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

s3_bucket

ANSIBLE VERSION
2.8
ADDITIONAL INFORMATION

With #46745, it allows to use s3_bucket with Scaleway Object Storage (if you're willing to test these changes with the Scaleway service, there is currently a free public beta).

@ansibot
Copy link
Contributor

ansibot commented Oct 10, 2018

Hi @pilou-,

Thank you for the pullrequest, just so you are aware we have a dedicated Working Group for aws.
You can find other people interested in this in #ansible-aws on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 aws bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. python3 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. traceback This issue/PR includes a traceback. labels Oct 10, 2018
@remyleone
Copy link
Contributor

I get the following message:

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Couldn't connect to AWS: Invalid endpoint: s3.nl-ams.scw.cloud"}

@pilou-
Copy link
Contributor Author

pilou- commented Oct 10, 2018

@sieben you need to test both this PR and #46745. The error you encountered is fixed by #46745.

@pilou- pilou- force-pushed the s3_bucket_handle_non_implemented_api branch from 6199888 to 5139d59 Compare October 10, 2018 17:34
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Oct 11, 2018
@remyleone
Copy link
Contributor

@remyleone
Copy link
Contributor

remyleone commented Oct 11, 2018

I still get recursion problem. I've rebased my PR on top of both of your changes

if isinstance(other, Mapping):\nRuntimeError: maximum recursion depth exceeded while calling a Python object\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"

@pilou- pilou- force-pushed the s3_bucket_handle_non_implemented_api branch 2 times, most recently from 2f79500 to d303957 Compare October 12, 2018 00:27
@mattclay
Copy link
Member

CI failure in integration tests: https://app.shippable.com/github/ansible/ansible/runs/88071/67/tests

@mattclay mattclay added the ci_verified Changes made in this PR are causing tests to fail. label Oct 12, 2018
@pilou- pilou- force-pushed the s3_bucket_handle_non_implemented_api branch 2 times, most recently from 484f1ae to 06d7c08 Compare October 13, 2018 00:15
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Oct 13, 2018
@pilou- pilou- force-pushed the s3_bucket_handle_non_implemented_api branch from 06d7c08 to 982b944 Compare October 13, 2018 12:41
@pilou- pilou- changed the title s3_bucket: don't always call policy/requestPayment/versioning API WIP: s3_bucket: don't always call policy/requestPayment/versioning API Oct 13, 2018
@pilou- pilou- force-pushed the s3_bucket_handle_non_implemented_api branch from 982b944 to 779559b Compare October 14, 2018 00:02
@ansibot ansibot removed the support:community This issue/PR relates to code supported by the Ansible community. label Oct 14, 2018
@pilou- pilou- force-pushed the s3_bucket_handle_non_implemented_api branch from 779559b to 161893d Compare October 14, 2018 13:05
@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Oct 14, 2018
@pilou- pilou- force-pushed the s3_bucket_handle_non_implemented_api branch 2 times, most recently from 11b7e24 to 25c863b Compare October 14, 2018 15:44
@pilou- pilou- changed the title WIP: s3_bucket: don't always call policy/requestPayment/versioning API s3_bucket: don't always call policy/requestPayment/versioning API Oct 14, 2018
@pilou- pilou- force-pushed the s3_bucket_handle_non_implemented_api branch from 25c863b to c77487b Compare October 14, 2018 17:41
@ansibot ansibot removed the WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. label Oct 14, 2018
@pilou- pilou- force-pushed the s3_bucket_handle_non_implemented_api branch from c77487b to 206ac87 Compare October 19, 2018 00:09
@ansibot ansibot added 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 Oct 19, 2018
Don't fail when policy, requestPayment, tagging or versioning API is not
implemented by the endpoint and if related parameters policy, requester_pays,
tags or versioning are None.
@pilou- pilou- force-pushed the s3_bucket_handle_non_implemented_api branch from 206ac87 to e2d3186 Compare October 26, 2018 15:04
@pilou-
Copy link
Contributor Author

pilou- commented Oct 26, 2018

Rebased in order to trigger shippable.

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Oct 26, 2018
@mattclay
Copy link
Member

Closing and re-opening to trigger CI.

@mattclay mattclay closed this Oct 30, 2018
@mattclay mattclay reopened this Oct 30, 2018
@ansibot ansibot removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. 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 Oct 30, 2018
@bcoca bcoca merged commit d14f9dc into ansible:devel Nov 1, 2018
Tomorrow9 pushed a commit to Tomorrow9/ansible that referenced this pull request Dec 4, 2018
Don't fail when policy, requestPayment, tagging or versioning API is not
implemented by the endpoint and if related parameters policy, requester_pays,
tags or versioning are None.
@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.8 This issue/PR affects Ansible v2.8 aws bug This issue/PR relates to a bug. cloud core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. python3 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. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants