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

Add notification/wechat module. #58696

Open
wants to merge 5 commits into
base: devel
from

Conversation

Projects
None yet
2 participants
@lework
Copy link

commented Jul 4, 2019

SUMMARY
This module can send a message via Wechat(https://work.weixin.qq.com).

ISSUE TYPE
New Module Pull Request
COMPONENT NAME
wechat

ADDITIONAL INFORMATION
This module can send a message via Wechat.

lework added some commits Jul 4, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jul 4, 2019

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

lib/ansible/modules/notification/wechat.py:152:16: bad-whitespace Exactly one space required after comma         response,info = fetch_url(self.module, url=url)                 ^
lib/ansible/modules/notification/wechat.py:154:12: trailing-whitespace Trailing whitespace
lib/ansible/modules/notification/wechat.py:165:28: trailing-whitespace Trailing whitespace
lib/ansible/modules/notification/wechat.py:186:20: trailing-whitespace Trailing whitespace
lib/ansible/modules/notification/wechat.py:190:28: trailing-whitespace Trailing whitespace
lib/ansible/modules/notification/wechat.py:197:16: bad-whitespace Exactly one space required after comma         response,info = fetch_url(self.module,url=send_url, data=self.msg, method='POST')                 ^
lib/ansible/modules/notification/wechat.py:197:45: bad-whitespace Exactly one space required after comma         response,info = fetch_url(self.module,url=send_url, data=self.msg, method='POST')                                              ^
lib/ansible/modules/notification/wechat.py:199:37: bad-whitespace No space allowed before :         if text['invaliduser'] != '' :                                      ^

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: ome_device_info (2981 previous rendering line(s) omitted)
*** recording category all in list_of_all_modules.rst ***
rendering: None
*** recording category cloud in list_of_cloud_modules.rst ***
rendering: None
*** recording category clustering in list_of_clustering_modules.rst ***
rendering: None
*** recording category commands in list_of_commands_modules.rst ***
rendering: None
*** recording category crypto in list_of_crypto_modules.rst ***
rendering: None
*** recording category database in list_of_database_modules.rst ***
rendering: None
*** recording category files in list_of_files_modules.rst ***
rendering: None
*** recording category identity in list_of_identity_modules.rst ***
rendering: None
*** recording category inventory in list_of_inventory_modules.rst ***
rendering: None
*** recording category messaging in list_of_messaging_modules.rst ***
rendering: None
*** recording category monitoring in list_of_monitoring_modules.rst ***
rendering: None
*** recording category net_tools in list_of_net_tools_modules.rst ***
rendering: None
*** recording category network in list_of_network_modules.rst ***
rendering: None
*** recording category notification in list_of_notification_modules.rst ***
rendering: None
*** recording category packaging in list_of_packaging_modules.rst ***
rendering: None
*** recording category remote_management in list_of_remote_management_modules.rst ***
rendering: None
*** recording category source_control in list_of_source_control_modules.rst ***
rendering: None
*** recording category storage in list_of_storage_modules.rst ***
rendering: None
*** recording category system in list_of_system_modules.rst ***
rendering: None
*** recording category utilities in list_of_utilities_modules.rst ***
rendering: None
*** recording category web_infrastructure in list_of_web_infrastructure_modules.rst ***
rendering: None
*** recording category windows in list_of_windows_modules.rst ***
rendering: None
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 811, in main
    process_support_levels(plugin_info, categories, templates, output_dir, plugin_type)
  File "../bin/plugin_formatter.py", line 697, in process_support_levels
    raise AnsibleError('Unknown supported_by value: %s' % info['metadata']['supported_by'])
ansible.errors.AnsibleError: Unknown supported_by value: lework
make: *** [modules] Error 1

The test ansible-test sanity --test no-smart-quotes [explain] failed with 2 errors:

lib/ansible/modules/notification/wechat.py:42:72: use ASCII quotes `'` and `"` instead of Unicode quotes
lib/ansible/modules/notification/wechat.py:45:41: use ASCII quotes `'` and `"` instead of Unicode quotes

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

lib/ansible/modules/notification/wechat.py:37:94: W291 trailing whitespace
lib/ansible/modules/notification/wechat.py:61:1: W293 blank line contains whitespace
lib/ansible/modules/notification/wechat.py:77:1: W293 blank line contains whitespace
lib/ansible/modules/notification/wechat.py:139:9: E115 expected an indented block (comment)
lib/ansible/modules/notification/wechat.py:140:11: E111 indentation is not a multiple of four
lib/ansible/modules/notification/wechat.py:152:17: E231 missing whitespace after ','
lib/ansible/modules/notification/wechat.py:154:13: W291 trailing whitespace
lib/ansible/modules/notification/wechat.py:155:11: E111 indentation is not a multiple of four
lib/ansible/modules/notification/wechat.py:156:9: E722 do not use bare 'except'
lib/ansible/modules/notification/wechat.py:157:11: E111 indentation is not a multiple of four
lib/ansible/modules/notification/wechat.py:165:29: W291 trailing whitespace
lib/ansible/modules/notification/wechat.py:186:21: W291 trailing whitespace
lib/ansible/modules/notification/wechat.py:190:29: W291 trailing whitespace
lib/ansible/modules/notification/wechat.py:197:17: E231 missing whitespace after ','
lib/ansible/modules/notification/wechat.py:197:46: E231 missing whitespace after ','
lib/ansible/modules/notification/wechat.py:199:37: E203 whitespace before ':'
lib/ansible/modules/notification/wechat.py:200:12: E111 indentation is not a multiple of four
lib/ansible/modules/notification/wechat.py:202:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/notification/wechat.py:237:1: E305 expected 2 blank lines after class or function definition, found 1

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

lib/ansible/modules/notification/wechat.py:0:0: E105 GPLv3 license header not found in the first 20 lines of the module
lib/ansible/modules/notification/wechat.py:0:0: E307 version_added should be '2.9'. Currently '1.0'
lib/ansible/modules/notification/wechat.py:0:0: E316 ANSIBLE_METADATA.metadata_version: not a valid value for dictionary value @ data['metadata_version']. Got '1.0'
lib/ansible/modules/notification/wechat.py:0:0: E316 ANSIBLE_METADATA.supported_by: not a valid value for dictionary value @ data['supported_by']. Got 'lework'
lib/ansible/modules/notification/wechat.py:0:0: E337 Argument 'agentid' in argument_spec defines type as 'str' but documentation doesn't define type
lib/ansible/modules/notification/wechat.py:0:0: E337 Argument 'corpid' in argument_spec defines type as 'str' but documentation doesn't define type
lib/ansible/modules/notification/wechat.py:0:0: E337 Argument 'msg' in argument_spec defines type as 'str' but documentation doesn't define type
lib/ansible/modules/notification/wechat.py:0:0: E337 Argument 'secret' in argument_spec defines type as 'str' but documentation doesn't define type
lib/ansible/modules/notification/wechat.py:0:0: E337 Argument 'toparty' in argument_spec defines type as 'str' but documentation doesn't define type
lib/ansible/modules/notification/wechat.py:0:0: E337 Argument 'totag' in argument_spec defines type as 'str' but documentation doesn't define type
lib/ansible/modules/notification/wechat.py:0:0: E337 Argument 'touser' in argument_spec defines type as 'str' but documentation doesn't define type

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jul 4, 2019

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

lib/ansible/modules/notification/wechat.py:156:0: syntax-error invalid syntax (&lt;unknown&gt;, line 156)

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

lib/ansible/modules/notification/wechat.py:0:0: missing documentation (or could not parse documentation): invalid syntax (<unknown>, line 156)

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

lib/ansible/modules/notification/wechat.py:0:0: missing documentation (or could not parse documentation): invalid syntax (<unknown>, line 156)

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

lib/ansible/modules/notification/wechat.py:0:0: missing documentation (or could not parse documentation): invalid syntax (<unknown>, line 156)

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

lib/ansible/modules/notification/wechat.py:0:0: missing documentation (or could not parse documentation): invalid syntax (<unknown>, line 156)

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

lib/ansible/modules/notification/wechat.py:0:0: missing documentation (or could not parse documentation): invalid syntax (<unknown>, line 156)

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

lib/ansible/modules/notification/wechat.py:0:0: missing documentation (or could not parse documentation): invalid syntax (<unknown>, line 156)

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 815, in <module>
    main()
  File "../bin/plugin_formatter.py", line 770, 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 300, 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 40, in read_docstring
    M = ast.parse(b_module_data.read())
  File "/usr/lib/python3.6/ast.py", line 35, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 156
    except as ex:
            ^
SyntaxError: invalid syntax
make: *** [modules] Error 1

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

lib/ansible/modules/notification/wechat.py:156:17: SyntaxError: except as ex:

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

lib/ansible/modules/notification/wechat.py:156:17: SyntaxError: except as ex:

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

lib/ansible/modules/notification/wechat.py:156:17: SyntaxError: except as ex:

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

lib/ansible/modules/notification/wechat.py:156:17: SyntaxError: except as ex:

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

lib/ansible/modules/notification/wechat.py:156:17: SyntaxError: except as ex:

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

lib/ansible/modules/notification/wechat.py:156:16: SyntaxError: except as ex:

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

lib/ansible/modules/notification/wechat.py:156:17: SyntaxError: invalid syntax

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

lib/ansible/modules/notification/wechat.py:156:17: SyntaxError: invalid syntax

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

lib/ansible/modules/notification/wechat.py:156:17: SyntaxError: invalid syntax

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

lib/ansible/modules/notification/wechat.py:156:17: SyntaxError: invalid syntax

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

lib/ansible/modules/notification/wechat.py:156:17: SyntaxError: invalid syntax

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

lib/ansible/modules/notification/wechat.py:156:16: SyntaxError: invalid syntax

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

lib/ansible/modules/notification/wechat.py:154:13: W291 trailing whitespace

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

lib/ansible/modules/notification/wechat.py:0:0: E401 Python SyntaxError while parsing module

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

lib/ansible/modules/notification/wechat.py:156:17: python-syntax-error invalid syntax (<unknown>, line 156)

click here for bot help

lework added some commits Jul 4, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jul 4, 2019

@Deepakkothandan @Im0 @Jmainguy @bjolivot @bkimble @drew-russell @fabulops @garbled1 @jcftang @jcgruenhage @jpmens @makaimc @marc-sensenich @mcodd @mpdehaan @pb8226 @shirou @tksmd @tonyseek @tyouxa @weaselkeeper @willybarro @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.