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

Allow passing through of (almost) all params available … #58118

Open
wants to merge 3 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@stefanhorning
Copy link
Contributor

commented Jun 20, 2019

…on boto3 methods in aws_api_gateway.

SUMMARY

The boto methods in use for aws_api_gateway allow more params. So this PR allows to set them through the Ansible module too. See https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/apigateway.html#client

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

aws_api_gateway module.

ADDITIONAL INFORMATION

Simple extension of module params.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2019

@stefanhorning, 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

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2019

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

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:286:32: bad-whitespace No space allowed around keyword argument assignment                     description = module.params.get('deploy_desc'),                                 ^
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:287:34: bad-whitespace No space allowed around keyword argument assignment                     cache_enabled = module.params.get('cache_enabled'),                                   ^
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:288:31: bad-whitespace No space allowed around keyword argument assignment                     cache_size = module.params.get('cache_size'),                                ^
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:289:30: bad-whitespace No space allowed around keyword argument assignment                     variables = module.params.get('stage_variables'),                               ^
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:290:36: bad-whitespace No space allowed around keyword argument assignment                     canary_settings = module.params.get('stage_canary_settings'),                                     ^
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:291:36: bad-whitespace No space allowed around keyword argument assignment                     tracing_enabled = module.params.get('tracing_enabled')                                     ^
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:305:106: bad-whitespace No space allowed after bracket     return client.create_rest_api(name="ansible-temp-api", description=description, endpointConfiguration={ 'types': [endpoint_type] })                                                                                                           ^
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:305:133: bad-whitespace No space allowed before bracket     return client.create_rest_api(name="ansible-temp-api", description=description, endpointConfiguration={ 'types': [endpoint_type] })                                                                                                                                      ^
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:319:0: dangerous-default-value Dangerous default value {} as argument
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:319:0: dangerous-default-value Dangerous default value {} as argument

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: missing documentation (or could not parse documentation): 'description'

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: missing documentation (or could not parse documentation): 'description'

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: missing documentation (or could not parse documentation): 'description'

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: missing documentation (or could not parse documentation): 'description'

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: missing documentation (or could not parse documentation): 'description'

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

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: missing documentation (or could not parse documentation): 'description'

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

Command "/usr/bin/python3.6 test/sanity/code-smell/docs-build.py" returned exit status 1.
>>> Standard Error
Command 'make singlehtmldocs' failed with status code: 2
--> Standard Output
PYTHONPATH=../../lib ../bin/dump_config.py --template-file=../templates/config.rst.j2 --output-dir=rst/reference_appendices/ -d ../../lib/ansible/config/base.yml
mkdir -p rst/cli
PYTHONPATH=../../lib ../bin/generate_man.py --template-file=../templates/cli_rst.j2 --output-dir=rst/cli/ --output-format rst ../../lib/ansible/cli/*.py
PYTHONPATH=../../lib ../bin/dump_keywords.py --template-dir=../templates --output-dir=rst/reference_appendices/ -d ./keyword_desc.yml
PYTHONPATH=../../lib ../bin/plugin_formatter.py -t rst --template-dir=../templates --module-dir=../../lib/ansible/modules -o rst/modules/ 
Evaluating module files...
rendering: redshift_facts (2652 previous rendering line(s) omitted)
Makefile:93: recipe for target 'modules' failed
--> Standard Error
Traceback (most recent call last):
  File "../bin/plugin_formatter.py", line 815, in <module>
    main()
  File "../bin/plugin_formatter.py", line 802, in main
    process_plugins(plugin_info, templates, outputname, output_dir, options.ansible_version, plugin_type)
  File "../bin/plugin_formatter.py", line 515, in process_plugins
    raise AnsibleError("Missing required description for parameter '%s' in '%s' " % (k, module))
ansible.errors.AnsibleError: Missing required description for parameter 'stage_canary_settings' in 'aws_api_gateway' 
make: *** [modules] Error 1

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

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:283:21: E126 continuation line over-indented for hanging indent
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:286:32: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:286:34: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:287:34: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:287:36: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:288:31: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:288:33: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:289:30: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:289:32: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:290:36: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:290:38: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:291:36: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:291:38: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:292:17: E121 continuation line under-indented for hanging indent
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:305:108: E201 whitespace after '{'
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:305:133: E202 whitespace before '}'
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:320:9: E128 continuation line under-indented for visual indent

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

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E305 DOCUMENTATION.options.stage_canary_settings.decription: extra keys not allowed @ data['options']['stage_canary_settings']['decription']. Got ['Canary settings for the deployment of the stage']
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E305 DOCUMENTATION.options.stage_canary_settings.description: required key not provided @ data['options']['stage_canary_settings']['description']. Got None
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E309 version_added for new option (stage_variables) should be '2.9'. Currently StrictVersion ('0.0')
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E324 Argument 'cache_size' in argument_spec defines default as ('0.5') but documentation defines default as (None)
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E324 Argument 'endpoint_type' in argument_spec defines default as ('EDGE') but documentation defines default as (None)

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2019

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

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:319:0: dangerous-default-value Dangerous default value {} as argument
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:319:0: dangerous-default-value Dangerous default value {} as argument

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

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:283:21: E126 continuation line over-indented for hanging indent
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:292:17: E121 continuation line under-indented for hanging indent
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:319:161: E501 line too long (169 > 160 characters)

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

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E309 version_added for new option (stage_variables) should be '2.9'. Currently StrictVersion ('0.0')
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E324 Argument 'cache_size' in argument_spec defines default as ('0.5') but documentation defines default as (None)
lib/ansible/modules/cloud/amazon/aws_api_gateway.py:0:0: E324 Argument 'endpoint_type' in argument_spec defines default as ('EDGE') but documentation defines default as (None)

click here for bot help

@ansibot ansibot added the ci_verified label Jun 20, 2019

@ansibot ansibot removed the ci_verified label Jun 24, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 24, 2019

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

lib/ansible/modules/cloud/amazon/aws_api_gateway.py:324:9: E128 continuation line under-indented for visual indent

click here for bot help

@ansibot ansibot removed the needs_triage label Jun 24, 2019

@ansibot ansibot added the stale_ci label Jul 2, 2019

# we can also get None as an argument so we don't do this as a default
return client.create_deployment(restApiId=api_id, stageName=stage, description=description)
def create_deployment(client, api_id=None, stage=None, description=None, cache_enabled=False, cache_size='0.5',
variables=None, canary_settings=None, tracing_enabled=False):

This comment has been minimized.

Copy link
@stefanhorning

stefanhorning Jul 9, 2019

Author Contributor

This method should probably be refactored to use keyword arguments instead, to reduce params list here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.