You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/lib/ansible
snipfoo 5f4e332e37
Fix condition for unquoting configuration strings from ini files (#82388)
* Add prefix to `origin` when configuration variables come from ini files

Fixes ansible#82387

This change was suggested by @bcoca in
https://github.com/ansible/ansible/pull/82388#discussion_r1424235728 and
https://github.com/ansible/ansible/pull/82388#discussion_r1424249732

When configuration variables come from an ini file, their `origin` is
now set to `ini: <file>`. Similarly, once supported, YAML configuration
files will have their `origin` as `yaml: <file>`.

Consequently, since unquoting configuration strings should happen if and
only if they come from an ini file, this condition boils down to testing
whether their `origin` starts with `ini:`.

* Do not add prefix to `origin` but explicitly pass `origin_ftype`

So as not to rely on a specific format of the `origin` string,
as suggested by @sivel in
https://github.com/ansible/ansible/pull/82388#issuecomment-1881714871
2 years ago
..
_vendor Require `from __future__ import annotations` (#81902) 2 years ago
cli ansible-doc: restore role attributes (#82678) 2 years ago
collections Require `from __future__ import annotations` (#81902) 2 years ago
compat Remove Python `< 3.5` `selectors` fallbacks (#81872) 2 years ago
config Fix condition for unquoting configuration strings from ini files (#82388) 2 years ago
errors Require `from __future__ import annotations` (#81902) 2 years ago
executor Allow check mode async task disabling check_mode (#82827) 2 years ago
galaxy Fix traceback and allow installing roles with version None (#81849) 2 years ago
inventory Require `from __future__ import annotations` (#81902) 2 years ago
module_utils Bump bundled distro version to 1.8.0 (#81765) 2 years ago
modules pylint: update for use-yield-from 2 years ago
parsing Enable file cache for vaulted host_vars_files vars plugin (#81995) 2 years ago
playbook fix wording in error msg (#82848) 2 years ago
plugins Remove deprecated scp_if_ssh from SSH connection plugin (#82072) 2 years ago
template Fix error when templating an unsafe string leading to a type error in Python (#82675) 2 years ago
utils Remove os.environ compat for py2 and deprecate ansible.utils.py3compat (#82794) 2 years ago
vars pylint: update for use-yield-from 2 years ago
__init__.py Require `from __future__ import annotations` (#81902) 2 years ago
__main__.py Require `from __future__ import annotations` (#81902) 2 years ago
constants.py Require `from __future__ import annotations` (#81902) 2 years ago
context.py Require `from __future__ import annotations` (#81902) 2 years ago
keyword_desc.yml Fix the strategy plugin description in keywords (#82113) 2 years ago
release.py Require `from __future__ import annotations` (#81902) 2 years ago