* Remove raw byte-strings from cliconf plugins of supported platforms + edgeos
Remove uses of to_bytes, too
* Update CliConfBase docstring to reflect current position on byte strings
* Include change classification data in metadata.
* Add support for disabled tests.
* Add support for unstable tests.
* Add support for unsupported tests.
* Overhaul integration aliases sanity test.
* Update Shippable scripts to handle unstable tests.
* Mark unstable Azure tests.
* Mark unstable Windows tests.
* Mark disabled tests.
* Start of tests for ansible.module_utils.urls
* Start adding file for generic functions throughout urls
* Add tests for maybe_add_ssl_handler
* Remove commented out line
* Improve coverage of maybe_add_ssl_handler, test basic_auth_header
* Start tests for open_url
* pep8 and ignore urlopen in test_url_open.py tests
* Extend auth tests, add test for validate_certs=False
* Finish tests for open_url
* Add tests for fetch_url
* Add fetch_url tests to replace-urlopen ignore
* dummy instead of _
* Add BadStatusLine test
* Reorganize/rename tests
* Add tests for RedirectHandlerFactory
* Add POST test to confirm behavior is to convert to GET
* Update tests to handle recent changes to RedirectHandlerFactory
* Special test, just to confirm that aliasing http_error_308 to http_error_307 does not cause issues with urllib2 type redirects
* tolerate windows line endings when loading windows module utils. Helpful for old custom windows modules.
* add test modules to demonstrate win line ending module load behaviour.
* attempt to fix sanity check failures
* pep8 fix
* explict skip of test modules from shebang check (core modules must still have expected unix style line endings)
* switch to rstrip() following core team meeting feedback
* Use arg_spec type for comparisons on default and choices
* Further improve type casting
* Make sure to capture output in more places
* Individually report invalid choices
* Update ignore.txt after resolving merge conflicts
* Clean up Grafana docs a bit
But more is needed, default values, missing choices, proper
descriptions, actual sentences :-)
* Remove validate-modules entries
Remove module from ignore lists and some documentation fix in
digital_ocean_block_storage and digital_ocean module.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Ensure we merge doc fragments early, for comparisons
* Perform boolean conversion from arg_spec data too
* Update valdiate-modules ignore.txt due to recent changes
* Wildcard imports should be taken care of. Enable the pylint check for them
* Remove wildcard import code-smell test as we're now checking via pylint
* Add unused-wildcard-import as ignored in our compat code.
These three files use wildcard imports so that they can export
symbols in a compatible location. The real code lives elsewhere.
So disable the pylint tests for the relevant sections of code.
Enforce module deprecation.
After module has reached the end of it's deprecation cycle we will replace it with a docs stub.
* Replace deprecated modules with docs-only sub
* Use of deprecated past deprecation cycle gives meaningful message (see examples below)
* Enforce documentation.deprecation dict via `schema.py`
* Update `ansible-doc` and web docs to display documentation.deprecation
* Document that structure in `dev_guide`
* Ensure that all modules starting with `_` have a `deprecation:` block
* Ensure `deprecation:` block is only used on modules that start with `_`
* `removed_in` A string which represents when this module needs **deleting**
* CHANGELOG.md and porting_guide_2.5.rst list removed modules as well as alternatives
* CHANGELOG.md links to porting guide index
To ensure that meaningful messages are given to the user if they try to use a module at the end of it's deprecation cycle we enforce the module to contain:
```python
if __name__ == '__main__':
removed_module()
```
* fix broken import
Error was:
lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py:223:0: NameError: name 'ARecord' is not defined
* doc: use formatting functions
* remove unused dict
* Skip parameters that are being deprecated
So in most cases when parameters are deprecated, you may not want to
advertise them in the documentation. One reason for this is because
these parameters were not introduced within Ansible but predate
upstreaming them.
So this change avoids reporting parameters that are not documented and
are deprecated. It's only a small subset of the existing E322 errors.
* Add support for E323 with these changes
* Unsure about the other issues now
* Add better error message with E321
* Restore some erroneously remove files
* Readd false positives to ignore.txt
* compare arg+aliases between docs and argument_spec
* Add some special handling for the network modules provider options that also appear in the top level arg spec
* Fix error code for bigip_hostname
* Address merge conflicts due to changes in f5 modules
* Update validate-modules ignore based off a clean execution
* Address merge conflicts
* Address renamed module
* Address recent changes to modules
* Add ignore for ucs_ip_pool
* Update aci modules to get more reliable documentation comparison, but not mutating the module_utils aci_argument_spec
* Update ignore.txt after recent aci updates
* Add extra guard to ensure we handle provider special only for network modules
* Address additional changes to modules
* allow shells to have per host options, remote_tmp
added language to shell
removed module lang setting from general as plugins have it now
use get to avoid bad powershell plugin
more resilient tmp discovery, fall back to `pwd`
add shell to docs
fixed options for when frags are only options
added shell set ops in t_e and fixed option frags
normalize tmp dir usag4e
- pass tmpdir/tmp/temp options as env var to commands, making it default for tempfile
- adjusted ansiballz tmpdir
- default local tempfile usage to the configured local tmp
- set env temp in action
add options to powershell
shift temporary to internal envvar/params
ensure tempdir is set if we pass var
ensure basic and url use expected tempdir
ensure localhost uses local tmp
give /var/tmp priority, less perms issues
more consistent tempfile mgmt for ansiballz
made async_dir configurable
better action handling, allow for finally rm tmp
fixed tmp issue and no more tempdir in ballz
hostvarize world readable and admin users
always set shell tempdir
added comment to discourage use of exception/flow control
* Mostly revert expand_user as it's not quite working.
This was an additional feature anyhow.
Kept the use of pwd as a fallback but moved it to a second ssh
connection. This is not optimal but getting that to work in a single
ssh connection was part of the problem holding this up.
(cherry picked from commit 395b714120522f15e4c90a346f5e8e8d79213aca)
* fixed script and other action plugins
ensure tmpdir deletion
allow for connections that don't support new options (legacy, 3rd party)
fixed tests
* Add validation for the next to last line of a module
* Fix last error code
* Reduce to a single conditional
* Fix conditionals
* Move the final warnings statement to main() in mysql_replication
This patch is primarily a refactor to make the validate-modules arg-spec
no longer generate a traceback. It additionally includes removal of deprecated
code in the virtual server module.
The main patch is to remove the traceback generating code. There are
other small fixes that were made in addition to doing that.
* Removed re-def of cleanup_tokens.
* Changed parameter args to be keywords.
* Changed imports to include new module_util locations.
* Imports also include developing (sideband) module_util locations.
* Changed to using F5Client and plain AnsibleModule to prevent tracebacks caused by missing libraries.
* Removed init and update methods from most Parameter classes (optimization) as its now included in module_utils.
* Changed module and module param references to take into account the new self.module arg.
* Minor bug fixes made during this refactor.
The main purpose of this patch is to do the refactor that
supports replacing tracebacks with fail_json. Additionally, the
following was done.
* Removed re-def of cleanup_tokens.
* Changed parameter args to be keywords.
* Changed imports to include new module_util locations.
* Imports also include developing (sideband) module_util locations.
* Changed to using F5Client and plain AnsibleModule to prevent tracebacks caused by missing libraries.
* Removed init and update methods from most Parameter classes (optimization) as its now included in module_utils.
* Changed module and module param references to take into account the new self.module arg.
* Minor bug fixes made during this refactor.
Primarily, this patch contains refactors to remove tracebacks that
are generated when libraries are missing. There is also,
* Removed re-def of cleanup_tokens.
* Changed parameter args to be keywords.
* Changed imports to include new module_util locations.
* Imports also include developing (sideband) module_util locations.
* Changed to using F5Client and plain AnsibleModule to prevent tracebacks caused by missing libraries.
* Removed init and update methods from most Parameter classes (optimization) as its now included in module_utils.
* Changed module and module param references to take into account the new self.module arg. Minor bug fixes made during this refactor.
This patch was primarily an effort to reduce traceback errors for
work that sivel was doing. Part of (and in some cases in addition to)
that, the following was done.
* Removed re-def of cleanup_tokens.
* Changed parameter args to be keywords.
* Changed imports to include new module_util locations.
* Imports also include developing (sideband) module_util locations.
* Changed to using F5Client and plain AnsibleModule to prevent tracebacks caused by missing libraries.
* Removed init and update methods from most Parameter classes (optimization) as its now included in module_utils.
* Changed module and module param references to take into account the new self.module arg.
* Minor bug fixes made during this refactor.
* fix broken import
* ansible.module_utils.ec2.HAS_BOTO is already used
* wait_timeout parameter: use 'int' type
* wait is always True there
* doc: use formatting function
* Update validate-modules arg_spec introspection to be faster, by only mocking the imports we explicitly list
* The use of types.MethodType in redhat_subscription wasn't py3 compatible, use partial instead
* Remove argument_spec import hacks, make them errors, we can ignore them with ansible-test
* Enable the --arg-spec flag for validate-modules
* Resolve newly added tests as filters
* Add code smell to test for ansible provided jinja tests as filters syntax
* Add docs for no-tests-as-filters code smell test
* Address tests as filters in new integration tests
* Address feedback
* Address feedback 2
* Update validation test for new copyright
Ensure new modules without the new copyright header fail
validation
Ensure existing modules without copyright in top 20 lines fail
* Add documentation of 108 error
Create label in developing modules documentation so that
the validation page can point to it
* Ensure new style copyright header passes test!
* Bulk pep8 fixes - hand crafted
Fix by hand the remaining issues that autopep8 couldn't
* Next batch of hand crafted pep8 fixes
* Ignore W503
https://github.com/PyCQA/pycodestyle/pull/499
* Revert more of W503
* - Netconf plugin addition for iosxr
- Utilities refactoring to support netconf and cliconf
- iosx_banner refactoring for netconf and cliconf
- Integration testcases changes to accomodate above changes
* Fix sanity failures, shippable errors and review comments
* fix pep8 issue
* changes run_command method to send specific command args
* - Review comment fixes
- iosxr_command changes to remove ComplexDict based command_spec
* - Move namespaces removal method from utils to netconf plugin
* Minor refactoring in utils and change in deprecation message
* rewrite build_xml logic and import changes for new utils dir structure
* - Review comment changes and minor changes to documentation
* * refactor common code and docs updates
* Refactor common network shared and platform specific code into package (part-1)
As per proposal #76 refactor common network shared and platform specific
code into sub-package.
https://github.com/ansible/proposals/issues/76
* ansible.module_utils.network.common - command shared functions
* ansible.module_utils.network.{{ platform }} - where platform is platform specific shared functions
* Fix review comments
* Fix review comments
Empty __init__ will allow us to use python namespaces with all of these
files. That may be something we want to take advantage of for allowign
them to be expanded by user dirs. Also might be needed for AnsiballZ or
other wrapper enhancements in the future.
* Remove uses of assert in production code
* Fix assertion
* Add code smell test for assertions, currently limited to lib/ansible
* Fix assertion
* Add docs for no-assert
* Remove new assert from enos
* Fix assert in module_utils.connection
* Moving modules from lenovo to cnos
* Merge conflicts
* Update cnos_conditional_template.py
Removed
180:5: E265 block comment should start with '# '
188:34: E226 missing whitespace around arithmetic operator
* Update cnos_template.py
155:5: E265 block comment should start with '# '
162:34: E226 missing whitespace around arithmetic operator
* Update cnos_vlan.py
210:1: E302 expected 2 blank lines, found 1
* Update cnos_backup.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_bgp.py
Added
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_backup.py
Added a line extra
* Update cnos_command.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_conditional_command.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_conditional_template.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_factory.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_facts.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_image.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_interface.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_portchannel.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_reload.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_rollback.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_save.py
Add
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_showrun.py
Add
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_template.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_vlag.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_vlan.py
Adding
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
* Update cnos_backup.py
Moving it to top of file
* Update cnos_backup.py
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Moving future and metaclass to top
* Putting condition to bye pass paramiko
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Condition to byepass paramiko import error
* Removing unused import and white spaces
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Dealing with white space and import issues
* Update cnos_template.py
* Ansible files module sanity pep8 fixes
* Ansible system module and playbook base.py
* Undo empty lines not required by sanity checks
* Undo empty lines not required by sanity checks
* Undo empty lines not required by sanity checks
* Undo empty lines not required by sanity checks
* Undo empty lines not required by sanity checks
* Undo empty lines not required by sanity checks
* Undo empty lines not required by sanity checks
* Undo empty lines not required by sanity checks
* Undo empty lines not required by sanity checks
* Undo empty lines not required by sanity checks
* Undo empty lines not required by sanity checks
* Various changes
* Various changes
* Various changes
* Various changes
* Undo blank lines not required by sanity checks
* Various changes
* Various changes
* Various changes
* Various changes
* Various changes
* Undo blank line changes not required by sanity checks
* Various changes
* Various changes
* Various changes
* Various changes
* Various changes
* Missing piece after merge
* Blank lines
* Blank line
* Line too long
* Fix typo
* Unnecessary quotes
* Fix example error
This fix allows user to specify alternative maintenance DB
required for initial connection in Postgresql_db module.
Also, adds pep8 related fixes.
Fixes: #30017
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
So we fixed everything that was not a module to be PEP8 compliant, and
in the meantime these 5 new files were additionally disabled from PEP8
testing.
This fixes it.
Also update Copyright/License statements.
This fix adds handling of error/exception message using
to_native API instead of decoding.
Also, fixes PEP8 errors.
Fixes: #31825
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Add some tests for iptables
* Fix remove bug (calls 2 times check to remove a chain)
* Add me as maintainer
* Fix PEP8
* Doc: Give more information on issue #18988
* Fix#18988 and test it
* Fix doc (thanks Pillou)
* enable PEP8 check for iptables