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

Feat/rundeck key storage #50453

Open
wants to merge 10 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@aminx4
Copy link

aminx4 commented Jan 2, 2019

SUMMARY

Create a new module for using Rundeck API Key Storage

  • New Module Pull Request
COMPONENT NAME

rundeck_key_storage

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Jan 2, 2019

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

lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:40:31: W291 trailing whitespace
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:68:1: W293 blank line contains whitespace
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:79:1: W293 blank line contains whitespace
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:90:1: W293 blank line contains whitespace
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:101:1: W293 blank line contains whitespace
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:112:1: W293 blank line contains whitespace
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:123:1: W293 blank line contains whitespace

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

lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E305 DOCUMENTATION.rundeck_api_version: extra keys not allowed @ data['rundeck_api_version']. Got '27'
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E307 version_added should be 2.8. Currently 3.0.9
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E322 "check_mode" is listed in the argument_spec, but not documented in the module
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E322 "state" is listed in the argument_spec, but not documented in the module
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E324 Value for "default" from the argument_spec ('no') for "check_mode" does not match the documentation (None)
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E324 Value for "default" from the argument_spec ('present') for "state" does not match the documentation (None)
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E326 Value for "choices" from the argument_spec (['present', 'absent']) for "state" does not match the documentation ([])
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E326 Value for "choices" from the argument_spec (['yes', 'no']) for "check_mode" does not match the documentation ([])

click here for bot help

@ansibot ansibot removed the ci_verified label Jan 2, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Jan 2, 2019

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

lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E305 DOCUMENTATION.rundeck_api_version: extra keys not allowed @ data['rundeck_api_version']. Got '27'
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E307 version_added should be 2.8. Currently 3.0.9
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E322 "check_mode" is listed in the argument_spec, but not documented in the module
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E322 "state" is listed in the argument_spec, but not documented in the module
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E324 Value for "default" from the argument_spec ('no') for "check_mode" does not match the documentation (None)
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E324 Value for "default" from the argument_spec ('present') for "state" does not match the documentation (None)
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E326 Value for "choices" from the argument_spec (['present', 'absent']) for "state" does not match the documentation ([])
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E326 Value for "choices" from the argument_spec (['yes', 'no']) for "check_mode" does not match the documentation ([])

click here for bot help

@ansibot ansibot added the ci_verified label Jan 2, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Jan 2, 2019

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

lib/ansible/modules/web_infrastructure/rundeck_key_storage.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/web_infrastructure/rundeck_key_storage.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/web_infrastructure/rundeck_key_storage.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/web_infrastructure/rundeck_key_storage.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/web_infrastructure/rundeck_key_storage.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/python test/sanity/code-smell/docs-build.py" returned exit status 1.
>>> Standard Error
Command 'make singlehtmldocs' failed with status code: 2
--> Standard Output
cat _themes/srtd/static/css/theme.css | sed -e 's/^[ 	]*//g; s/[ 	]*$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$/d' | sed -e :a -e '$!N; s/\n\(.\)/\1/; ta' > _themes/srtd/static/css/theme.min.css
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 754, in <module>
    main()
  File "../bin/plugin_formatter.py", line 709, 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 294, 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 103, 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 35, in get_single_data
    node = self.get_single_node()
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 110, in compose_sequence_node
    while not self.check_event(SequenceEndEvent):
  File "/usr/local/lib/python3.6/dist-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/local/lib/python3.6/dist-packages/yaml/parser.py", line 393, in parse_block_sequence_entry
    "expected <block end>, but found %r" % token.id, token.start_mark)
yaml.parser.ParserError: while parsing a block collection
  in "<unicode string>", line 38, column 13:
                - 'present' value will add key i ... 
                ^
expected <block end>, but found '<scalar>'
  in "<unicode string>", line 38, column 25:
                - 'present' value will add key if not exist  ... 
                            ^
make: *** [modules] Error 1

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

lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E324 Value for "default" from the argument_spec ('no') for "check_mode" does not match the documentation (None)
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E324 Value for "default" from the argument_spec ('present') for "state" does not match the documentation (None)
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E324 Value for "default" from the argument_spec (14) for "api_version" does not match the documentation (None)
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E326 Value for "choices" from the argument_spec (['present', 'absent']) for "state" does not match the documentation ([])
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E326 Value for "choices" from the argument_spec (['private_key', 'public_key', 'password']) for "type" does not match the documentation ([])
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:0:0: E326 Value for "choices" from the argument_spec (['yes', 'no']) for "check_mode" does not match the documentation ([])
lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:55:25: E302 DOCUMENTATION is not valid YAML

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

lib/ansible/modules/web_infrastructure/rundeck_key_storage.py:55:25: error DOCUMENTATION: syntax error: expected <block end>, but found '<scalar>'

click here for bot help

@ansibot ansibot removed the ci_verified label Jan 2, 2019

@aminx4 aminx4 force-pushed the aminx4:feat/rundeck_key_storage branch from 06a3327 to dc1fb19 Jan 2, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Jan 3, 2019

@AlanCoding @MatrixCrawler @Slezhuk @agmezr @berendt @fleu42 @getjack @ghjm @hogarthj @inetfuture @jainnikhil30 @jhoekx @jlaska @jtyr @lekum @matburt @mattupstate @n0trax @nerzhul @oboukili @ramondelafuente @robinro @rooftopcellist @ryanpetrello @scottanderson42 @sermilrod @simfarm @stearz @stpierre @tarka @tastychutney @wbrefvem @wwitzel3

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

@nerzhul
Copy link
Contributor

nerzhul left a comment

A little change, algorithm seems good but not tested


if self.module.params["type"] == "private_key":
content_type = "application/octet-stream"
if self.module.params["type"] == "public_key":

This comment has been minimized.

@nerzhul

nerzhul Jan 3, 2019

Contributor

elif on each condition :) this will not change

This comment has been minimized.

@aminx4

aminx4 Jan 3, 2019

it's done 👍 thank you.

This comment has been minimized.

@aminx4

aminx4 Jan 3, 2019

@nerzhul
Can you please give me an exemple of unit test to add it please, i'm trying to find unit test for rundeck_project and rundeck_acl_policy modules but i can't find them.

thank you for your help 👍

This comment has been minimized.

@nerzhul

nerzhul Jan 3, 2019

Contributor

yeah unittests are not really applicable on rundeck modules because we need a working rundeck instance. @gundalow do you got some ideas ?

This comment has been minimized.

@aminx4

aminx4 Jan 3, 2019

@nerzhul Normally we can mock the calls to rundeck webservices, i'm not a python developper but i think there is a way to do it 👍

This comment has been minimized.

@aminx4

aminx4 Jan 7, 2019

@gundalow Hello :) any ideas ?

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