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

Onesixtyone inventory plugin (Fixes #41443) #53036

Closed
wants to merge 14 commits into from

Conversation

victorock
Copy link
Contributor

@victorock victorock commented Feb 26, 2019

SUMMARY

Add inventory plugin for onesixtyone, which is lightweight and fast in discovery of devices running SNMP.

Fixes #41443

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

onesixtyone

ADDITIONAL INFORMATION
ansible-inventory -i inventory --list
{
    "_meta": {
        "hostvars": {
            "ip-172-16-96-168.eu-central-1.compute.internal": {
                "ansible_host": "172.16.96.168", 
                "ansible_network_os": "ios", 
                "snmp_community": "public", 
                "snmp_sysdescr": "Cisco IOS Software [Gibraltar], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.10.1b, RELEASE SOFTWARE (fc1)  Technical Support: http://www.cisco.com/techsupport  Copyright (c) 1986-2018 by Cisco Systems, Inc.  Compiled Wed 12-Dec-18 02"
            }
        }
    }, 
    "all": {
        "children": [
            "ios", 
            "ungrouped"
        ]
    }, 
    "ios": {
        "hosts": [
            "ip-172-16-96-168.eu-central-1.compute.internal"
        ]
    }, 
    "ungrouped": {}
}

@ansibot
Copy link
Contributor

ansibot commented Feb 26, 2019

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

lib/ansible/plugins/inventory/onesixtyone.py:105:17: bad-whitespace No space allowed after bracket           jobs = [ gevent.spawn(self._add_device, self, device) for device in self._discovery() ]                  ^
lib/ansible/plugins/inventory/onesixtyone.py:105:96: bad-whitespace No space allowed before bracket           jobs = [ gevent.spawn(self._add_device, self, device) for device in self._discovery() ]                                                                                                 ^
lib/ansible/plugins/inventory/onesixtyone.py:130:0: trailing-whitespace Trailing whitespace
lib/ansible/plugins/inventory/onesixtyone.py:203:0: missing-final-newline Final newline missing
lib/ansible/plugins/inventory/onesixtyone.py:203:0: mixed-line-endings Mixed line endings LF and CRLF

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

docs/docsite/rst/dev_guide/developing_inventory.rst:35:0: undefined-label: undefined label: host_list_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:37:0: undefined-label: undefined label: yaml_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:41:0: undefined-label: undefined label: ini_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:111:0: undefined-label: undefined label: host_list_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:209:0: undefined-label: undefined label: auto_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: auto_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: ini_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: yaml_inventory (if the link has no caption the label must precede a section header)

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

lib/ansible/plugins/inventory/onesixtyone.py:68:3: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:69:3: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:70:1: E722 do not use bare 'except'
lib/ansible/plugins/inventory/onesixtyone.py:71:3: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:92:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:93:15: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:94:19: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:95:19: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:96:23: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:105:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:105:19: E201 whitespace after '['
lib/ansible/plugins/inventory/onesixtyone.py:105:96: E202 whitespace before ']'
lib/ansible/plugins/inventory/onesixtyone.py:106:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:129:15: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:130:1: W293 blank line contains whitespace
lib/ansible/plugins/inventory/onesixtyone.py:145:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:146:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:147:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:148:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:149:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:151:11: E114 indentation is not a multiple of four (comment)
lib/ansible/plugins/inventory/onesixtyone.py:152:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:166:15: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:175:15: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:176:15: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:177:15: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:179:19: E121 continuation line under-indented for hanging indent
lib/ansible/plugins/inventory/onesixtyone.py:189:7: E114 indentation is not a multiple of four (comment)
lib/ansible/plugins/inventory/onesixtyone.py:190:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:191:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:193:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:194:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:196:7: E114 indentation is not a multiple of four (comment)
lib/ansible/plugins/inventory/onesixtyone.py:197:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:198:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:199:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:200:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:201:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:202:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:203:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:203:80: W292 no newline at end of file

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 feature This issue/PR relates to a feature request. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. new_plugin This PR includes a new plugin. support:community This issue/PR relates to code supported by the Ansible community. labels Feb 26, 2019
@ansibot
Copy link
Contributor

ansibot commented Feb 27, 2019

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

lib/ansible/plugins/inventory/onesixtyone.py:105:17: bad-whitespace No space allowed after bracket           jobs = [ gevent.spawn(self._add_device, self, device) for device in self._discovery() ]                  ^
lib/ansible/plugins/inventory/onesixtyone.py:105:96: bad-whitespace No space allowed before bracket           jobs = [ gevent.spawn(self._add_device, self, device) for device in self._discovery() ]                                                                                                 ^
lib/ansible/plugins/inventory/onesixtyone.py:130:0: trailing-whitespace Trailing whitespace
lib/ansible/plugins/inventory/onesixtyone.py:203:0: missing-final-newline Final newline missing
lib/ansible/plugins/inventory/onesixtyone.py:203:0: mixed-line-endings Mixed line endings LF and CRLF

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

docs/docsite/rst/dev_guide/developing_inventory.rst:35:0: undefined-label: undefined label: host_list_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:37:0: undefined-label: undefined label: yaml_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:41:0: undefined-label: undefined label: ini_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:111:0: undefined-label: undefined label: host_list_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:209:0: undefined-label: undefined label: auto_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: auto_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: ini_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: yaml_inventory (if the link has no caption the label must precede a section header)

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

lib/ansible/plugins/inventory/onesixtyone.py:68:3: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:69:3: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:70:1: E722 do not use bare 'except'
lib/ansible/plugins/inventory/onesixtyone.py:71:3: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:92:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:93:15: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:94:19: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:95:19: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:96:23: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:105:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:105:19: E201 whitespace after '['
lib/ansible/plugins/inventory/onesixtyone.py:105:96: E202 whitespace before ']'
lib/ansible/plugins/inventory/onesixtyone.py:106:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:129:15: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:130:1: W293 blank line contains whitespace
lib/ansible/plugins/inventory/onesixtyone.py:145:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:146:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:147:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:148:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:149:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:151:11: E114 indentation is not a multiple of four (comment)
lib/ansible/plugins/inventory/onesixtyone.py:152:11: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:166:15: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:175:15: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:176:15: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:177:15: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:179:19: E121 continuation line under-indented for hanging indent
lib/ansible/plugins/inventory/onesixtyone.py:189:7: E114 indentation is not a multiple of four (comment)
lib/ansible/plugins/inventory/onesixtyone.py:190:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:191:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:193:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:194:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:196:7: E114 indentation is not a multiple of four (comment)
lib/ansible/plugins/inventory/onesixtyone.py:197:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:198:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:199:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:200:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:201:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:202:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:203:7: E111 indentation is not a multiple of four
lib/ansible/plugins/inventory/onesixtyone.py:203:80: W292 no newline at end of file

click here for bot help

lib/ansible/plugins/inventory/onesixtyone.py Outdated Show resolved Hide resolved
lib/ansible/plugins/inventory/onesixtyone.py Outdated Show resolved Hide resolved
lib/ansible/plugins/inventory/onesixtyone.py Outdated Show resolved Hide resolved
lib/ansible/plugins/inventory/onesixtyone.py Outdated Show resolved Hide resolved
lib/ansible/plugins/inventory/onesixtyone.py Outdated Show resolved Hide resolved
lib/ansible/plugins/inventory/onesixtyone.py Outdated Show resolved Hide resolved
@ansibot
Copy link
Contributor

ansibot commented Feb 27, 2019

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

docs/docsite/rst/dev_guide/developing_inventory.rst:35:0: undefined-label: undefined label: host_list_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:37:0: undefined-label: undefined label: yaml_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:41:0: undefined-label: undefined label: ini_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:111:0: undefined-label: undefined label: host_list_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:209:0: undefined-label: undefined label: auto_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: auto_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: ini_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: yaml_inventory (if the link has no caption the label must precede a section header)

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

lib/ansible/plugins/inventory/onesixtyone.py:69:1: E722 do not use bare 'except'
lib/ansible/plugins/inventory/onesixtyone.py:75:1: E722 do not use bare 'except'

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Feb 27, 2019

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

docs/docsite/rst/dev_guide/developing_inventory.rst:35:0: undefined-label: undefined label: host_list_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:37:0: undefined-label: undefined label: yaml_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:41:0: undefined-label: undefined label: ini_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:111:0: undefined-label: undefined label: host_list_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:209:0: undefined-label: undefined label: auto_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: auto_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: ini_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: yaml_inventory (if the link has no caption the label must precede a section header)

click here for bot help

lib/ansible/plugins/inventory/onesixtyone.py Outdated Show resolved Hide resolved
lib/ansible/plugins/inventory/onesixtyone.py Outdated Show resolved Hide resolved
@ansibot
Copy link
Contributor

ansibot commented Feb 27, 2019

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

docs/docsite/rst/dev_guide/developing_inventory.rst:35:0: undefined-label: undefined label: host_list_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:37:0: undefined-label: undefined label: yaml_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:41:0: undefined-label: undefined label: ini_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:111:0: undefined-label: undefined label: host_list_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:209:0: undefined-label: undefined label: auto_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: auto_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: ini_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: yaml_inventory (if the link has no caption the label must precede a section header)

click here for bot help

@victorock
Copy link
Contributor Author

victorock commented Feb 27, 2019

@bcoca @Akasurde @webknjaz please review

@ansibot
Copy link
Contributor

ansibot commented Feb 27, 2019

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

lib/ansible/plugins/inventory/onesixtyone.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

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

docs/docsite/rst/dev_guide/developing_inventory.rst:35:0: undefined-label: undefined label: host_list_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:37:0: undefined-label: undefined label: yaml_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:41:0: undefined-label: undefined label: ini_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:111:0: undefined-label: undefined label: host_list_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/dev_guide/developing_inventory.rst:209:0: undefined-label: undefined label: auto_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: auto_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: ini_inventory (if the link has no caption the label must precede a section header)
docs/docsite/rst/porting_guides/porting_guide_2.8.rst:237:0: undefined-label: undefined label: yaml_inventory (if the link has no caption the label must precede a section header)

click here for bot help

@victorock
Copy link
Contributor Author

@bcoca @Akasurde any additional requirement to fix?

lib/ansible/plugins/inventory/onesixtyone.py Outdated Show resolved Hide resolved
lib/ansible/plugins/inventory/onesixtyone.py Outdated Show resolved Hide resolved
lib/ansible/plugins/inventory/onesixtyone.py Outdated Show resolved Hide resolved
lib/ansible/plugins/inventory/onesixtyone.py Outdated Show resolved Hide resolved
- organize errors/exceptions
- add trailing ','
- remove '^' from regex
@victorock victorock force-pushed the onesixtyone-inventory-plugin branch from bacb574 to 80b8e51 Compare May 16, 2019 11:03
@ansibot ansibot removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. labels May 16, 2019
@webknjaz webknjaz requested review from Akasurde and bcoca and removed request for Akasurde May 16, 2019 11:42
DOCUMENTATION = '''
name: onesixtyone
plugin_type: inventory
version_added: "2.8"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version_added: "2.8"
version_added: "2.9"

try:
from netaddr import IPSet
HAS_NETADDR = True
except Exception:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ImportError?

NAME = 'onesixtyone'

def __init__(self):
super(InventoryModule, self).__init__()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty proxy-init doesn't make sense and should be removed.

# Find the onesixtyone binary
try:
self._onesixtyone = get_bin_path(self.NAME, True)
except Exception:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use actual exception which may happen. Wholesale catch-all is bad.

}
platforms.update(self.get_option('platform'))

for platform, rule in platforms.items():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for platform, rule in platforms.items():
return next(platform for platform, rule in platforms.items() if rule.match(text), 'unknown')

communities_tempfile.flush()

# add command-line option -c
cmd.append('-c')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be probably better readable with

Suggested change
cmd.append('-c')
cmd.extend(('-c', communities_tempfile.name))

instead


# execute
try:
self.display.vvv("running command: {cmd}".format(cmd=cmd_string))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go outside of try block

matches = None

for line in cmd_output.splitlines():
self.display.vvv("parsing output line: {line}".format(line=line))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably go to the debug level

if host.endswith('.in-addr.arpa'):
obj.display.vvv("Reverse DNS for host {host} contains 'in-addr.arpa', using {ansible_host}`".format(host=host, ansible_host=ansible_host))
host = ansible_host
except Exception:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no wholesale exceptions plz

@ansibot ansibot added stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. labels May 24, 2019
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_review Updates were made after the last review and the last review is more than 7 days old. labels Mar 3, 2020
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_review Updates were made after the last review and the last review is more than 7 days old. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Mar 27, 2020
@Akasurde
Copy link
Member

Hi @victorock, Thank you very much for your interest in Ansible. This plugin/module is no longer maintained in this repository and has been migrated to https://github.com/ansible-collections/community.general

If you have further questions please stop by IRC or the mailing list:

* IRC: #ansible on irc.freenode.net
* mailing list: https://groups.google.com/forum/#!forum/ansible-project

needs_info

@Akasurde Akasurde closed this Aug 20, 2020
@ansible ansible locked as resolved and limited conversation to collaborators Aug 20, 2020
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Aug 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 feature This issue/PR relates to a feature request. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_plugin This PR includes a new plugin. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inventory plugin for snmp discovery
6 participants