[AWS iam_policy] Avoid the _undefined name_ by catching the raised exception into the variable __e__ so it can be reported on the following line.
flake8 testing of https://github.com/ansible/ansible on Python 3.6.3
$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./lib/ansible/modules/cloud/amazon/iam_policy.py:305:16: F821 undefined name 'e'
if e.errno == 2:
^
./lib/ansible/modules/cloud/misc/rhevm.py:594:24: F821 undefined name 'e'
setMsg(str(e))
^
./lib/ansible/modules/files/archive.py:391:92: F821 undefined name 'e'
module.fail_json(dest=dest, msg='Error deleting some source files: ' + str(e), files=errors)
^
3 F821 undefined name 'e'
3
```
* Create base class for network-style connections
* clean up some differences
* Move NetworkConnectionBase
* Tweak netconf for tests
* Tweak when network_os is checked to avoid failing tests
* Pull back exec_command
* request() has improved error reporting
- 5xx errors show same as before
- 3xx and 4xx errors show error body
* Print body for errors greater than 300, but less than 500
* Remove trailing whitespace
Avoid the _undefined name_ and mirror lines 389 and 459 by catching the raised exception in the variable __exc__ so it can be reported on the following line.
flake8 testing of https://github.com/ansible/ansible on Python 3.6.3
$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./lib/ansible/module_utils/network/iosxr/iosxr.py:414:42: F821 undefined name 'exc'
module.fail_json(msg=to_text(exc))
^
```
* Revert "Account for empty string regexp in lineinfile (#41451)"
This reverts commit 4b5b4a760c.
* Use context managers for interacting with files
* Store line and regexp parameters in a variable
* Add warning when regexp is an empty string
* Remove '=' from error messages
* Update warning message and add changelog
* Add tests
* Improve warning message
Offer an equivalent regexp that won't trigger the warning.
Update tests to match new warning.
* Add porting guide entry for lineinfile change
* pamd: typo fix sufficicent->sufficient
* pamd: is_valid is a property, not a method; return a tuple
* pamd: define is_valid for all PamdLine classes
* pamd: use validate() for verbose errors, define generically
* pamd: PamdRule: rule_control is always str, use _control
Fixes https://github.com/ansible/ansible/issues/41179
* elasticsearch_plugin - Show STDERR on module failures.
I tried to install a ES plugin without
become: yes
and found after debugging the module that the module failed ude to permission issues.
The only error message I got was
Is analysis-icu a valid plugin name?
That was strange considering I followed the example documentation by the letter.
I found out that when this module fails, it hides the real reason for failure.
This patch replaces the generic error with more meaningful diagnostics.
* elasticsearch_plugin - Show STDERR on module failures. Changelog fragment
samdoran commented 2 days ago
This looks good. Please create a changelog fragment to go along with this change. See fragments for examples.
* Fix bug with redundancy templates and add integration tests for redundancy templates.
* vlan_list absent state support and fix for vlans as strings in vlan_list
* Fix junos_config confirm commit issue
Fixes#40626
* Due to issue in ncclient commit() method for Juniper
device (ncclient/ncclient#238)
add a workaround in junos netconf plugin to generate proper
commit-configuration xml and execute it using ncclient
generic `rpc()` method.
* Update junos_config doc
* Add run_commands api for ios and vyos cliconf plugin
* Add run_commands api to ios and vyos cliconf plugin
* Refactor ios and vyos module_utils to check return code
in run_commands
* Fix Ci failures
Currently TestCreateJavaKeystore::test_create_jks_success is failing on
a machine with SELinux because set_context_if_different is not mocked
and hence tries to access a file that doesn't exist because it has been
mocked previously.
Also, changing path to a path that won't exist for sure.
Certain project functions are not available on the openstack public api. Creating and deleting projects are examples where you must use the admin api.
In most devstack or simple openstack deployments the public, internal and admin apis may live at the IP. However in most production deployments the admin APIs are on a separate network than the public APIs. Therefore for these examples to consistently work, we must specify the admin endpoint_type.