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 Lightsail_tag to handle tags for lightsail instances #57887

Open
wants to merge 9 commits into
base: devel
from

Conversation

Projects
None yet
2 participants
@thyme-87
Copy link
Contributor

commented Jun 15, 2019

SUMMARY

I wrote a lightsail_tag module that mimics the behavior of the ec2_tag module. It can handle both key-only and the normal key-value tags.

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

lightsail_tag

ADDITIONAL INFORMATION

I provided a documentation and tested the module documentation as described here https://docs.ansible.com/ansible/latest/dev_guide/testing_documentation.html#testing-module-documentation


@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

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

lib/ansible/modules/cloud/amazon/lightsail_tag.py:127:0: bare-except No exception type(s) specified
lib/ansible/modules/cloud/amazon/lightsail_tag.py:168:12: undefined-variable Undefined variable 'module'
lib/ansible/modules/cloud/amazon/lightsail_tag.py:168:33: undefined-variable Undefined variable 'e'
lib/ansible/modules/cloud/amazon/lightsail_tag.py:168:102: undefined-variable Undefined variable 'tag_list'
lib/ansible/modules/cloud/amazon/lightsail_tag.py:210:8: bad-whitespace Exactly one space required around assignment     tags=[]         ^
lib/ansible/modules/cloud/amazon/lightsail_tag.py:216:16: bad-whitespace Exactly one space required after assignment             tag =  {'key': key, 'value': value}                 ^
lib/ansible/modules/cloud/amazon/lightsail_tag.py:221:15: bad-whitespace Exactly one space required around assignment     module_args=dict(                ^
lib/ansible/modules/cloud/amazon/lightsail_tag.py:245:14: bad-whitespace Exactly one space required before comparison     if state  == 'list':               ^^

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

lib/ansible/modules/cloud/amazon/lightsail_tag.py:15:161: E501 line too long (259 > 160 characters)
lib/ansible/modules/cloud/amazon/lightsail_tag.py:127:1: E722 do not use bare 'except'
lib/ansible/modules/cloud/amazon/lightsail_tag.py:130:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/amazon/lightsail_tag.py:210:9: E225 missing whitespace around operator
lib/ansible/modules/cloud/amazon/lightsail_tag.py:216:18: E222 multiple spaces after operator
lib/ansible/modules/cloud/amazon/lightsail_tag.py:220:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/amazon/lightsail_tag.py:221:16: E225 missing whitespace around operator
lib/ansible/modules/cloud/amazon/lightsail_tag.py:222:13: E126 continuation line over-indented for hanging indent
lib/ansible/modules/cloud/amazon/lightsail_tag.py:226:13: E123 closing bracket does not match indentation of opening bracket's line
lib/ansible/modules/cloud/amazon/lightsail_tag.py:245:13: E221 multiple spaces before operator
lib/ansible/modules/cloud/amazon/lightsail_tag.py:282:1: E305 expected 2 blank lines after class or function definition, found 1

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

lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E322 Argument 'aws_region' is listed in the argument_spec, but not documented in the module documentation
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E322 Argument 'ec2_region' is listed in the argument_spec, but not documented in the module documentation
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E337 Argument 'instance_name' in argument_spec defines type as 'str' but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E337 Argument 'tags' in argument_spec defines type as 'dict' but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E338 Argument 'region' in argument_spec uses default type ('str') but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E338 Argument 'state' in argument_spec uses default type ('str') but documentation doesn't define type

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

@thyme-87, 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 removed the ci_verified label Jun 15, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

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

lib/ansible/modules/cloud/amazon/lightsail_tag.py:184:12: undefined-variable Undefined variable 'module'
lib/ansible/modules/cloud/amazon/lightsail_tag.py:184:33: undefined-variable Undefined variable 'e'
lib/ansible/modules/cloud/amazon/lightsail_tag.py:184:103: undefined-variable Undefined variable 'tag_list'

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

lib/ansible/modules/cloud/amazon/lightsail_tag.py:15:161: E501 line too long (259 > 160 characters)
lib/ansible/modules/cloud/amazon/lightsail_tag.py:130:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/amazon/lightsail_tag.py:226:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/amazon/lightsail_tag.py:232:9: E123 closing bracket does not match indentation of opening bracket's line
lib/ansible/modules/cloud/amazon/lightsail_tag.py:288:1: E305 expected 2 blank lines after class or function definition, found 1

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

lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E337 Argument 'instance_name' in argument_spec defines type as 'str' but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E337 Argument 'tags' in argument_spec defines type as 'dict' but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E338 Argument 'state' in argument_spec uses default type ('str') but documentation doesn't define type

click here for bot help

@ansibot ansibot added ci_verified and removed ci_verified labels Jun 15, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

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

lib/ansible/modules/cloud/amazon/lightsail_tag.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/lightsail_tag.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/lightsail_tag.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/lightsail_tag.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/lightsail_tag.py:0:0: has a documentation error formatting or is missing documentation.

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...
Makefile:93: recipe for target 'modules' failed
--> Standard Error
Traceback (most recent call last):
  File "../bin/plugin_formatter.py", line 813, in <module>
    main()
  File "../bin/plugin_formatter.py", line 768, in main
    plugin_info, categories = get_plugin_info(options.module_dir, limit_to=options.limit_to, verbose=(options.verbosity > 0))
  File "../bin/plugin_formatter.py", line 298, in get_plugin_info
    doc, examples, returndocs, metadata = plugin_docs.get_docstring(module_path, fragment_loader, verbose=verbose)
  File "/root/ansible/lib/ansible/utils/plugin_docs.py", line 111, in get_docstring
    data = read_docstring(filename, verbose=verbose, ignore_errors=ignore_errors)
  File "/root/ansible/lib/ansible/parsing/plugin_docs.py", line 59, in read_docstring
    data[varkey] = AnsibleLoader(child.value.s, file_name=filename).get_single_data()
  File "/usr/local/lib/python3.6/dist-packages/yaml/constructor.py", line 41, in get_single_data
    node = self.get_single_node()
  File "ext/_yaml.pyx", line 707, in _yaml.CParser.get_single_node
  File "ext/_yaml.pyx", line 725, in _yaml.CParser._compose_document
  File "ext/_yaml.pyx", line 776, in _yaml.CParser._compose_node
  File "ext/_yaml.pyx", line 890, in _yaml.CParser._compose_mapping_node
  File "ext/_yaml.pyx", line 774, in _yaml.CParser._compose_node
  File "ext/_yaml.pyx", line 853, in _yaml.CParser._compose_sequence_node
  File "ext/_yaml.pyx", line 905, in _yaml.CParser._parse_next_event
yaml.scanner.ScannerError: while scanning a simple key
  in "<unicode string>", line 7, column 5
could not find expected ':'
  in "<unicode string>", line 8, column 5
make: *** [modules] Error 1

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

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

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

lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E324 Argument 'state' in argument_spec defines default as ('list') but documentation defines default as (None)
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E324 Argument 'validate_certs' in argument_spec defines default as (True) but documentation defines default as (False)
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E326 Argument 'state' in argument_spec defines choices as (['present', 'absent', 'list']) but documentation defines choices as ([])
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E337 Argument 'debug_botocore_endpoint_logs' in argument_spec defines type as 'bool' but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E337 Argument 'instance_name' in argument_spec defines type as 'str' but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E337 Argument 'purge_tags' in argument_spec defines type as 'bool' but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E337 Argument 'tags' in argument_spec defines type as 'dict' but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E337 Argument 'validate_certs' in argument_spec defines type as 'bool' but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E338 Argument 'aws_access_key' in argument_spec uses default type ('str') but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E338 Argument 'aws_secret_key' in argument_spec uses default type ('str') but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E338 Argument 'ec2_url' in argument_spec uses default type ('str') but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E338 Argument 'profile' in argument_spec uses default type ('str') but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E338 Argument 'region' in argument_spec uses default type ('str') but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E338 Argument 'security_token' in argument_spec uses default type ('str') but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:0:0: E338 Argument 'state' in argument_spec uses default type ('str') but documentation doesn't define type
lib/ansible/modules/cloud/amazon/lightsail_tag.py:17:5: E302 DOCUMENTATION is not valid YAML

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

lib/ansible/modules/cloud/amazon/lightsail_tag.py:17:5: error DOCUMENTATION: syntax error: could not find expected ':'

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

@BobBoldin @Constantin007 @Constantin07 @Deepakkothandan @Etherdaemon @Java1Guy @Madhura-CSI @MichaelBaydoun @Sodki @Zeekin @adq @akazakov @alachaum @amir343 @anryko @bekelchik @brandond @captainkerk @chenl87 @defionscode @defunctio @dennisconrad @dkhenry @fiunchinho @fivethreeo @flowerysong @garethr @gobins @gunzy83 @gurumaia @hsingh @hyperized @iiibrad @infectsoldier @j-carl @jarv @jimbydamonk @jmenga @joelthompson @jonhadfield @jonmer85 @joshsouza @jsdalton @jsmartin @kaczynskid @leedm777 @linuxdynasty @loia @lwade @michaeljs1990 @minichate @mjschultz @mmochan @nand0p @naslanidis @nathanwebsterdotme @nerzhul @nickball @orthanc @ozbillwang @piontas @pjodouin @prasadkatti @psykotox @ptux @pwnall @raags @rafaeldriutti @rickmendes @roadmapper @rrey @ruimoreira @ryansydnor @scicoin-project @scottanderson42 @sdubrul @shepdelacreme @silviud @slapula @stefanhorning @steynovich @tastychutney @tgerla @timmahoney @tomislacker @tsiganenok @viper233 @whiter @willricardo @wilvk @wimnat @yaakov-github @zacblazic @zbal @zimbatm

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

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.