* Fix redundant yaml error blurbs on ModArgs parse errors
Some of the AnsibleParserErrors from parsing.mod_args
are created with the obj=some_yaml_ds options but
some are not.
If they were, we don't want to add another yaml_ds to
it, because that will result in double yaml error blurbs.
And since we dont need to add info, we can just re raise it.
But if there is no ._obj, add it here so we get the extra
detail in the error message (see issue #14790) and raise
a new AnsibleParserError instance.
Fixes#36848
* cleanup existing test_tasks pep8/sanity issues
* Don't mask values specified in data.
This heavily improves readability of error messages such as
'Authorization for ******** returned in********: CHALLENGE: ********-01 DETAILS: Incorrect TXT record "********" (and 1 more) found at ********.********;'
(verbatim quote).
* Added documentation.
This PR makes and adjustment for Python 3 scoping rules which differ from Python 2. In Python 3, the variable __ex__ goes out of scope at the exit of the __try-except__ block. This means that when __ex__ is referred to on the lines that follow, it would be an _undefined name_ causing a __NameError__ to be raised instead of the expected __ConnectionError__.
flake8 testing of https://github.com/ansible/ansible on Python 3.6.3
The command "echo ; echo -n "flake8 testing of ${URL} on " ; python -V" exited with 0.
130.72s$ time flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
./lib/ansible/module_utils/api.py:114:21: F823 local variable 'retry_count' (defined in enclosing scope on line 107) referenced before assignment
retry_count += 1 # pylint: disable=undefined-variable
^
./lib/ansible/module_utils/six/__init__.py:54:20: F821 undefined name 'basestring'
string_types = basestring,
^
./lib/ansible/module_utils/six/__init__.py:55:27: F821 undefined name 'long'
integer_types = (int, long)
^
./lib/ansible/module_utils/six/__init__.py:57:17: F821 undefined name 'unicode'
text_type = unicode
^
./lib/ansible/module_utils/six/__init__.py:658:16: F821 undefined name 'unicode'
return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape")
^
./lib/ansible/module_utils/six/__init__.py:754:37: F821 undefined name 'basestring'
if not isinstance(data, basestring):
^
./lib/ansible/module_utils/six/__init__.py:757:32: F821 undefined name 'file'
if (isinstance(fp, file) and
^
./lib/ansible/module_utils/six/__init__.py:758:38: F821 undefined name 'unicode'
isinstance(data, unicode) and
^
./lib/ansible/module_utils/six/__init__.py:768:32: F821 undefined name 'unicode'
if isinstance(sep, unicode):
^
./lib/ansible/module_utils/six/__init__.py:774:32: F821 undefined name 'unicode'
if isinstance(end, unicode):
^
./lib/ansible/module_utils/six/__init__.py:782:36: F821 undefined name 'unicode'
if isinstance(arg, unicode):
^
./lib/ansible/module_utils/six/__init__.py:786:23: F821 undefined name 'unicode'
newline = unicode("\n")
^
./lib/ansible/module_utils/six/__init__.py:787:21: F821 undefined name 'unicode'
space = unicode(" ")
^
./lib/ansible/modules/cloud/misc/rhevm.py:594:24: F821 undefined name 'e'
setMsg(str(e))
^
./lib/ansible/modules/cloud/openstack/os_user.py:202:38: F821 undefined name 'shade'
if description and StrictVersion(shade.__version__) < StrictVersion('1.13.0'):
^
./lib/ansible/modules/cloud/openstack/os_volume.py:153:27: F821 undefined name 'shade'
StrictVersion(shade.__version__) < StrictVersion('1.22')):
^
./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)
^
./lib/ansible/modules/network/dellos9/dellos9_facts.py:379:24: F821 undefined name 'key'
parsed[key] += '\n%s' % line
^
./lib/ansible/modules/network/dellos9/dellos9_facts.py:399:24: F821 undefined name 'key'
parsed[key] += '\n%s' % line
^
./lib/ansible/modules/network/dellos9/dellos9_facts.py:403:24: F821 undefined name 'key'
parsed[key] += '\n%s' % line
^
./lib/ansible/modules/network/dellos9/dellos9_facts.py:418:24: F821 undefined name 'key'
parsed[key] += '\n%s' % line
^
./lib/ansible/modules/network/f5/bigip_device_httpd.py:461:40: F821 undefined name 'ex'
if 'Connection aborted' in str(ex) and 'redirectHttpToHttps' in params:
^
./lib/ansible/modules/network/f5/bigip_device_httpd.py:465:33: F821 undefined name 'ex'
raise F5ModuleError(str(ex))
^
./lib/ansible/modules/network/ironware/ironware_facts.py:274:24: F821 undefined name 'key'
parsed[key] += '\n%s' % line
^
./lib/ansible/modules/network/ironware/ironware_facts.py:514:24: F821 undefined name 'key'
parsed[key] += '\n%s' % line
^
24 F821 undefined name 'basestring'
1 F823 local variable 'retry_count' (defined in enclosing scope on line 107) referenced before assignment
25
* Clean up Grafana docs a bit
But more is needed, default values, missing choices, proper
descriptions, actual sentences :-)
* Remove validate-modules entries
* Added parameters to na_cdot_volume
Before this commit there were no parameter for creating a volume
and exporting it as NFS volume. The added parameters are:
- *junction-path* for specifying where to mount the volume in the namespace
- *export-policy* for specifying which export policy to apply to the given namespace
- *snapshot-policy* if required, applying a snapshot policy for scheduling data protection tasks
* Sanity fixes
* Sanity fixes (2)
* add additional test coverage for tower modules
* add test coverage for the tower_credential module
* add test coverage for the tower_user module
* fix a bug in py3 for tower_credential when ssh_key_data is specified
* add test coverage for tower_host, tower_label, and tower_project
* add test coverage for tower_inventory and tower_job_template
* add more test coverage for tower modules
- tower_job_launch
- tower_job_list
- tower_job_wait
- tower_job_cancel
* add a check mode/version assertion for tower module integration tests
* add test coverage for the tower_role module
* add test coverage for the tower_group module
* add more integration test edge cases for various tower modules
* give the job_wait module more time before failing
* randomize passwords in the tower_user and tower_group tests
* Increase delay and tries for ec2_vpc_net backoff
Wait for DHCP option to be created in ec2_vpc_dhcp_option
Wait for all modifications to the VPC
* Use the vpc_available waiter because is uses Filters
* Missed one
* Optimize retries to only occur if the functionality is available
* Increase max wait time
* Add comments to explain what the waiters are doing
* maven_artifact: add verify_checksum option - fixes#31799
* maven_artifact: some cleaning
* Remove blank lines to please the format checker
* Now targeting 2.6...
* fix typos
* use formatting functions
* use 'job template' instead of 'job_template'
* acronyms: user uppercase
* become_enabled param is about privilege escalation
* Check that connection error msg are not unsafe
* Connection error messages are unsafe: wrap them
For example, in case of error, docker connection plugin returns exception
message containing Go template. These messages weren't tagged as unsafe
and were consequently rendered:
The conditional check 'result is failed' failed. The error was:
{
'msg': u'Docker version check ([\'/usr/bin/docker\', \'version\', \'--format\', "\'{{.Server.Version}}\'"]) failed: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/version: dial unix /var/run/docker.sock: connect: permission denied\n',
'failed': True
}:
template error while templating string: unexpected '.'.
String: Docker version check (['/usr/bin/docker', 'version', '--format', "'{{.Server.Version}}'"]) failed: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/version: dial unix /var/run/docker.sock: connect: permission denied
* eos can not check config without config session support
* add testcase for check_mode without config session
* fix eos eapi to read use_session env var
This PR includes:
- A fix for multiple-choice defaults
- A fix for messed up dictionary samples
- Cleaner defaults when they don't appear part of choices
I wrote this code because we had a traceback at some point with pyyaml
not able to handle our AnsibleUnicode type (the C library was doing an
exact match to python's unicode type rather than testing with the object
inheritance hierarchy.) Neither jimi think that AnsibleUnicode gets
passed into this function anymore, though, so we think it is safe to remove.