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

threat_rule module #61280

Merged
merged 10 commits into from Aug 29, 2019

Conversation

@chkp-orso
Copy link
Contributor

commented Aug 25, 2019

SUMMARY

Checkpoint threat_rule module

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

checkpoint

ADDITIONAL INFORMATION

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Aug 25, 2019

@chkp-orso this PR contains more than one new module.

Please submit only one new module per pull request. For a detailed explanation, please read the grouped modules documentation

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Aug 25, 2019

@chkp-orso, just so you are aware we have a dedicated Working Group for network.
You can find other people interested in this in #ansible-network 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 Aug 25, 2019

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

Command "ansible-doc -t module cp_mgmt_threat_rule cp_mgmt_threat_rule_facts" returned exit status 1.
>>> Standard Error
[WARNING]: While constructing a mapping from
/root/ansible/lib/ansible/modules/network/checkpoint/cp_mgmt_threat_rule.py,
line 73, column 5, found a duplicate dict key (description). Using last defined
value only.
 [WARNING]: While constructing a mapping from
/root/ansible/lib/ansible/modules/network/checkpoint/cp_mgmt_threat_rule.py,
line 73, column 5, found a duplicate dict key (type). Using last defined value
only.
ERROR! module cp_mgmt_threat_rule_facts missing documentation (or could not parse documentation): mapping values are not allowed in this context
  in "<unicode string>", line 8, column 40

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

Command "/usr/bin/python3.6 /root/ansible/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 ../../hacking/build-ansible.py collection-meta --template-file=../templates/collections_galaxy_meta.rst.j2 --output-dir=rst/dev_guide/ ../../lib/ansible/galaxy/data/collections_galaxy_meta.yml
PYTHONPATH=../../lib ../../hacking/build-ansible.py document-config --template-file=../templates/config.rst.j2 --output-dir=rst/reference_appendices/ ../../lib/ansible/config/base.yml
mkdir -p rst/cli
PYTHONPATH=../../lib ../../hacking/build-ansible.py generate-man --template-file=../templates/cli_rst.j2 --output-dir=rst/cli/ --output-format rst ../../lib/ansible/cli/*.py
PYTHONPATH=../../lib ../../hacking/build-ansible.py document-keywords --template-dir=../templates --output-dir=rst/reference_appendices/ ./keyword_desc.yml
PYTHONPATH=../../lib ../../hacking/build-ansible.py document-plugins -t rst --template-dir=../templates --module-dir=../../lib/ansible/modules -o rst/modules/ 
Evaluating module files...
Makefile:99: recipe for target 'modules' failed
--> Standard Error
[WARNING]: While constructing a mapping from
../../lib/ansible/modules/network/checkpoint/cp_mgmt_threat_rule.py, line 73,
column 5, found a duplicate dict key (description). Using last defined value
only.
 [WARNING]: While constructing a mapping from
../../lib/ansible/modules/network/checkpoint/cp_mgmt_threat_rule.py, line 73,
column 5, found a duplicate dict key (type). Using last defined value only.
Traceback (most recent call last):
  File "../../hacking/build-ansible.py", line 88, in <module>
    main()
  File "../../hacking/build-ansible.py", line 79, in main
    retval = command.main(args)
  File "/root/ansible/hacking/build_library/build_ansible/command_plugins/plugin_formatter.py", line 711, in main
    plugin_info, categories = get_plugin_info(args.module_dir, limit_to=args.limit_to, verbose=(args.verbosity > 0))
  File "/root/ansible/hacking/build_library/build_ansible/command_plugins/plugin_formatter.py", line 225, 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 124, 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: mapping values are not allowed in this context
  in "<unicode string>", line 8, column 40
make: *** [modules] Error 1

The test ansible-test sanity --test package-data [explain] failed with the error:

Command "/usr/bin/python3.6 /root/ansible/test/sanity/code-smell/package-data.py" returned exit status 1.
>>> Standard Error
Traceback (most recent call last):
  File "/root/ansible/test/sanity/code-smell/package-data.py", line 383, in <module>
    main()
  File "/root/ansible/test/sanity/code-smell/package-data.py", line 360, in main
    sdist_path = create_sdist(tmp_dir)
  File "/root/ansible/test/sanity/code-smell/package-data.py", line 174, in create_sdist
    raise Exception('make snapshot failed:\n%s' % stderr)
Exception: make snapshot failed:
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
docs/man/man1/ansible-galaxy.1.rst:51: (WARNING/2) Definition list ends without a blank line; unexpected unindent.
docs/man/man1/ansible-galaxy.1.rst:57: (WARNING/2) Definition list ends without a blank line; unexpected unindent.
 [WARNING]: While constructing a mapping from
/tmp/tmp5lyge90r/lib/ansible/modules/network/checkpoint/cp_mgmt_threat_rule.py,
line 73, column 5, found a duplicate dict key (description). Using last defined
value only.
 [WARNING]: While constructing a mapping from
/tmp/tmp5lyge90r/lib/ansible/modules/network/checkpoint/cp_mgmt_threat_rule.py,
line 73, column 5, found a duplicate dict key (type). Using last defined value
only.
ERROR! module cp_mgmt_threat_rule_facts at /tmp/tmp5lyge90r/lib/ansible/modules/network/checkpoint/cp_mgmt_threat_rule_facts.py has a documentation error formatting or is missing documentation.
Traceback (most recent call last):
  File "packaging/release/changelogs/changelog.py", line 835, in <module>
    main()
  File "packaging/release/changelogs/changelog.py", line 102, in main
    args.func(args)
  File "packaging/release/changelogs/changelog.py", line 132, in command_release
    plugins = load_plugins(version=version, force_reload=reload_plugins)
  File "packaging/release/changelogs/changelog.py", line 184, in load_plugins
    '--json', '--metadata-dump', '-t', plugin_type])
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/tmp/tmp5lyge90r/bin/ansible-doc', '--json', '--metadata-dump', '-t', 'module']' returned non-zero exit status 1.
make: *** [changelog] Error 1

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Aug 25, 2019

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

Output on stderr from ansible-doc is considered an error.

Command "ansible-doc -t module cp_mgmt_threat_rule cp_mgmt_threat_rule_facts" returned exit status 0.
>>> Standard Error
[WARNING]: While constructing a mapping from
/root/ansible/lib/ansible/modules/network/checkpoint/cp_mgmt_threat_rule.py,
line 73, column 5, found a duplicate dict key (description). Using last defined
value only.
 [WARNING]: While constructing a mapping from
/root/ansible/lib/ansible/modules/network/checkpoint/cp_mgmt_threat_rule.py,
line 73, column 5, found a duplicate dict key (type). Using last defined value
only.
 [WARNING]: While constructing a mapping from /root/ansible/lib/ansible/modules
/network/checkpoint/cp_mgmt_threat_rule_facts.py, line 38, column 5, found a
duplicate dict key (description). Using last defined value only.
 [WARNING]: While constructing a mapping from /root/ansible/lib/ansible/modules
/network/checkpoint/cp_mgmt_threat_rule_facts.py, line 38, column 5, found a
duplicate dict key (type). Using last defined value only.

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

docs/docsite/rst/modules/list_of_all_modules.rst:709:0: undefined-label: undefined label: cp_mgmt_threat_rule_module (if the link has no caption the label must precede a section header)
docs/docsite/rst/modules/list_of_all_modules.rst:710:0: undefined-label: undefined label: cp_mgmt_threat_rule_facts_module (if the link has no caption the label must precede a section header)
docs/docsite/rst/modules/list_of_network_modules.rst:267:0: undefined-label: undefined label: cp_mgmt_threat_rule_module (if the link has no caption the label must precede a section header)
docs/docsite/rst/modules/list_of_network_modules.rst:268:0: undefined-label: undefined label: cp_mgmt_threat_rule_facts_module (if the link has no caption the label must precede a section header)

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Aug 25, 2019

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

Output on stderr from ansible-doc is considered an error.

Command "ansible-doc -t module cp_mgmt_threat_rule cp_mgmt_threat_rule_facts" returned exit status 0.
>>> Standard Error
[WARNING]: While constructing a mapping from
/root/ansible/lib/ansible/modules/network/checkpoint/cp_mgmt_threat_rule.py,
line 73, column 5, found a duplicate dict key (description). Using last defined
value only.
 [WARNING]: While constructing a mapping from
/root/ansible/lib/ansible/modules/network/checkpoint/cp_mgmt_threat_rule.py,
line 73, column 5, found a duplicate dict key (type). Using last defined value
only.
 [WARNING]: While constructing a mapping from /root/ansible/lib/ansible/modules
/network/checkpoint/cp_mgmt_threat_rule_facts.py, line 38, column 5, found a
duplicate dict key (description). Using last defined value only.
 [WARNING]: While constructing a mapping from /root/ansible/lib/ansible/modules
/network/checkpoint/cp_mgmt_threat_rule_facts.py, line 38, column 5, found a
duplicate dict key (type). Using last defined value only.

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

docs/docsite/rst/modules/list_of_all_modules.rst:709:0: undefined-label: undefined label: cp_mgmt_threat_rule_module (if the link has no caption the label must precede a section header)
docs/docsite/rst/modules/list_of_all_modules.rst:710:0: undefined-label: undefined label: cp_mgmt_threat_rule_facts_module (if the link has no caption the label must precede a section header)
docs/docsite/rst/modules/list_of_network_modules.rst:267:0: undefined-label: undefined label: cp_mgmt_threat_rule_module (if the link has no caption the label must precede a section header)
docs/docsite/rst/modules/list_of_network_modules.rst:268:0: undefined-label: undefined label: cp_mgmt_threat_rule_facts_module (if the link has no caption the label must precede a section header)

click here for bot help

chkp-orso added 4 commits Aug 25, 2019
Revert "insert to list"
This reverts commit de08dfd.
track_settings:
description:
- Threat rule track settings.
type: list

This comment has been minimized.

Copy link
@justjais

justjais Aug 27, 2019

Contributor

@chkp-orso This can be converted to dict instead of list

Suggested change
type: list
type: dict

@justjais justjais merged commit 09f4acb into ansible:devel Aug 29, 2019

1 check passed

Shippable Run 140502 status is SUCCESS.
Details

@sivel sivel removed the needs_triage label Aug 29, 2019

adharshsrivatsr added a commit to adharshsrivatsr/ansible that referenced this pull request Sep 3, 2019
threat_rule module (ansible#61280)
* threat_rule module

* remove :

* insert to list

* remove redundant indentation

* Revert "insert to list"

This reverts commit de08dfd.

* enable longer lines, remove present, add '-'

* state: present

* update examples

* list to dict

* remove rule_number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.