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

Update aws_api_gateway.py #42055

Open
wants to merge 10 commits into
base: devel
from

Conversation

@ToROxI

ToROxI commented Jun 28, 2018

Add ability to choose API Gateway by API name;
Add deletion of oldest stage when theirs count meets 10 (AWS`s limitation of stages count) and stage don't belong to the list of existing stages.

+label: docsite_pr

SUMMARY
ISSUE TYPE
  • Feature Pull Request
  • New Module Pull Request
  • Bugfix Pull Request
  • Docs Pull Request
COMPONENT NAME
ANSIBLE VERSION

ADDITIONAL INFORMATION

Update aws_api_gateway.py
Add ability to choose API Gateway by API name;
Add deletion of oldest stage when theirs count meets 10 (AWS`s limitation of stages count) and stage don't belong to the list of existing stages.

+label: docsite_pr
@ansibot

This comment has been minimized.

Contributor

ansibot commented Jun 28, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Jun 28, 2018

The test ansible-test sanity --test pep8 [explain] failed with 9 errors:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:123:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:133:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:196:57: E128 continuation line under-indented for visual indent
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:197:57: E128 continuation line under-indented for visual indent
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:281:49: E128 continuation line under-indented for visual indent
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:351:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:360:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:371:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:374:1: E302 expected 2 blank lines, found 1

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E309 version_added for new option (api_name) should be 2.7. Currently 0.0

click here for bot help

Update aws_api_gateway.py
Fix lint warnings
@ansibot

This comment has been minimized.

Contributor

ansibot commented Jun 28, 2018

The test ansible-test sanity --test pep8 [explain] failed with 4 errors:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:198:57: E128 continuation line under-indented for visual indent
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:199:57: E128 continuation line under-indented for visual indent
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:200:57: E128 continuation line under-indented for visual indent
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:284:49: E128 continuation line under-indented for visual indent

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E309 version_added for new option (api_name) should be 2.7. Currently 0.0

click here for bot help

@samdoran samdoran removed the needs_triage label Jun 28, 2018

@zakabluk

This comment has been minimized.

zakabluk commented Jun 29, 2018

@ToROxI

This comment has been minimized.

ToROxI commented Jun 29, 2018

@samdoran , are you ok with such results of quality checks?
Please provide some additional information if I need to fix some issues on my side.

Thanks!

Update aws_api_gateway.py
fix codestyle
@ansibot

This comment has been minimized.

Contributor

ansibot commented Jun 29, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E309 version_added for new option (api_name) should be 2.7. Currently 0.0

click here for bot help

@mattclay

This comment has been minimized.

Member

mattclay commented Jun 29, 2018

Update aws_api_gateway.py
add 'version_added' field

@ansibot ansibot removed the ci_verified label Jun 30, 2018

@ToROxI

This comment has been minimized.

ToROxI commented Jul 1, 2018

@mattclay ,
Hi!
Could I fix this issue from my side?

@dagwieers dagwieers added the docsite_pr label Jul 2, 2018

@mattclay

This comment has been minimized.

Member

mattclay commented Jul 3, 2018

@ToROxI The current integration test failure is here:

https://app.shippable.com/github/ansible/ansible/runs/72182/66/tests

It looks like the main failure is due to a traceback in the module:

Traceback (most recent call last):
  File "/tmp/ansible_hpr2UW/ansible_module_aws_api_gateway.py", line 407, in <module>
    main()
  File "/tmp/ansible_hpr2UW/ansible_module_aws_api_gateway.py", line 200, in main
    deploy_desc=deploy_desc)
  File "/tmp/ansible_hpr2UW/ansible_module_aws_api_gateway.py", line 284, in ensure_api_in_correct_state
    description=deploy_desc)
  File "/tmp/ansible_hpr2UW/ansible_modlib.zip/ansible/module_utils/cloud.py", line 153, in retry_func
IndexError: list index out of range

Can you run the tests locally to reproduce the issue?

Assuming you're running from the devel branch and have already sourced hacking/env-setup you can run the tests locally with: ansible-test integration aws_api_gateway --docker -v

You'll need to provide AWS credentials to run the tests.

@mattclay mattclay added the ci_verified label Jul 3, 2018

@ansibot ansibot added the stale_ci label Jul 11, 2018

ToROxI added some commits Jul 17, 2018

Update aws_api_gateway.py
fix for the issue that appears when there is no any stages deployed yet
@ansibot

This comment has been minimized.

Contributor

ansibot commented Jul 17, 2018

@ToROxI this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibot

This comment has been minimized.

Contributor

ansibot commented Jul 17, 2018

The test ansible-test sanity --test pylint [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:323:0: syntax-error invalid syntax (&lt;string&gt;, line 323)
test/sanity/pylint/ignore.txt:2:1: A102 Remove since "lib/ansible/modules/cloud/amazon/aws_api_gateway.py" passes "ansible-format-automatic-specification" pylint test

The test ansible-test sanity --test ansible-doc --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:323:18: SyntaxError: f stages_count == 0:

The test ansible-test sanity --test compile --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:323:18: SyntaxError: f stages_count == 0:

The test ansible-test sanity --test compile --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:323:18: SyntaxError: f stages_count == 0:

The test ansible-test sanity --test compile --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:323:18: SyntaxError: f stages_count == 0:

The test ansible-test sanity --test compile --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:323:18: SyntaxError: f stages_count == 0:

The test ansible-test sanity --test docs-build [explain] failed with the error:

Command "/usr/bin/python test/sanity/code-smell/docs-build.py" returned exit status 1.
>>> Standard Error
Traceback (most recent call last):
  File "test/sanity/code-smell/docs-build.py", line 101, in <module>
    main()
  File "test/sanity/code-smell/docs-build.py", line 17, in main
    raise subprocess.CalledProcessError(sphinx.returncode, cmd, output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['make', 'singlehtmldocs']' returned non-zero exit status 2.

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:323:18: SyntaxError: invalid syntax

The test ansible-test sanity --test import --python 2.7 [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: SyntaxError: invalid syntax (aws_api_gateway.py, line 323) (in /root/ansible/test/runner/.tox/minimal-py27/bin/importer.py:82)
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:323:18: SyntaxError: invalid syntax

The test ansible-test sanity --test import --python 3.5 [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: SyntaxError: invalid syntax (aws_api_gateway.py, line 323) (in /root/ansible/test/runner/.tox/minimal-py35/bin/importer.py:82)
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:323:18: SyntaxError: invalid syntax

The test ansible-test sanity --test import --python 3.6 [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: SyntaxError: invalid syntax (aws_api_gateway.py, line 323) (in /root/ansible/test/runner/.tox/minimal-py36/bin/importer.py:82)
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:323:18: SyntaxError: invalid syntax

The test ansible-test sanity --test import --python 3.7 [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: SyntaxError: invalid syntax (aws_api_gateway.py, line 323) (in /root/ansible/test/runner/.tox/minimal-py37/bin/importer.py:82)
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:323:18: SyntaxError: invalid syntax

The test ansible-test sanity --test validate-modules [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E401 Python SyntaxError while parsing module
test/sanity/validate-modules/ignore.txt:5:1: A102 Remove since "lib/ansible/modules/cloud/amazon/aws_api_gateway.py" passes "E322" test

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:323:18: python-syntax-error invalid syntax (<unknown>, line 323)

click here for bot help

Update aws_api_gateway.py
fix syntax mistake

@ryansb ryansb self-requested a review Jul 20, 2018

ToROxI added some commits Jul 23, 2018

Update aws_api_gateway.py
fix bug with false-positive error

@ansibot ansibot added the stale_ci label Jul 31, 2018

api_name:
description:
- Name of the API you want to manage.
version_added: '2.7'

This comment has been minimized.

@gundalow

gundalow Sep 25, 2018

Contributor

'2.8'

@ansibot ansibot removed the stale_ci label Sep 25, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Sep 25, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E309 version_added for new option (api_name) should be 2.8. Currently 2.7

click here for bot help

@willthames

This comment has been minimized.

Contributor

willthames commented Sep 25, 2018

This change needs tests and exception handling improvements (I realise the original exception handling is lacking) - see https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/amazon/GUIDELINES.md#exception-handling. Other than that the general approach seems sound and valid.

@ansibot ansibot added the stale_ci label Oct 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment