ansible-core 2.16.7__py3-none-any.whl → 2.17.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ansible-core might be problematic. Click here for more details.
- ansible/__init__.py +1 -3
- ansible/__main__.py +1 -0
- ansible/_vendor/__init__.py +1 -2
- ansible/cli/__init__.py +7 -8
- ansible/cli/adhoc.py +1 -2
- ansible/cli/arguments/__init__.py +1 -2
- ansible/cli/arguments/option_helpers.py +1 -2
- ansible/cli/config.py +1 -2
- ansible/cli/console.py +1 -2
- ansible/cli/doc.py +326 -202
- ansible/cli/galaxy.py +9 -3
- ansible/cli/inventory.py +4 -6
- ansible/cli/playbook.py +1 -2
- ansible/cli/pull.py +4 -5
- ansible/cli/scripts/ansible_connection_cli_stub.py +1 -4
- ansible/cli/vault.py +1 -2
- ansible/collections/list.py +1 -0
- ansible/compat/__init__.py +1 -4
- ansible/compat/importlib_resources.py +1 -2
- ansible/compat/{selectors/__init__.py → selectors.py} +12 -12
- ansible/config/ansible_builtin_runtime.yml +2 -0
- ansible/config/base.yml +154 -149
- ansible/config/manager.py +33 -25
- ansible/constants.py +1 -2
- ansible/context.py +1 -4
- ansible/errors/__init__.py +1 -3
- ansible/errors/yaml_strings.py +1 -3
- ansible/executor/__init__.py +1 -3
- ansible/executor/discovery/python_target.py +1 -2
- ansible/executor/interpreter_discovery.py +9 -8
- ansible/executor/module_common.py +1 -3
- ansible/executor/play_iterator.py +1 -3
- ansible/executor/playbook_executor.py +1 -3
- ansible/executor/powershell/module_manifest.py +2 -3
- ansible/executor/process/__init__.py +1 -3
- ansible/executor/process/worker.py +1 -3
- ansible/executor/stats.py +1 -3
- ansible/executor/task_executor.py +2 -3
- ansible/executor/task_queue_manager.py +1 -3
- ansible/executor/task_result.py +2 -3
- ansible/galaxy/__init__.py +1 -2
- ansible/galaxy/api.py +10 -2
- ansible/galaxy/collection/__init__.py +38 -24
- ansible/galaxy/collection/concrete_artifact_manager.py +1 -2
- ansible/galaxy/collection/galaxy_api_proxy.py +1 -2
- ansible/galaxy/collection/gpg.py +4 -2
- ansible/galaxy/data/apb/meta/main.yml.j2 +0 -15
- ansible/galaxy/data/container/meta/main.yml.j2 +0 -18
- ansible/galaxy/data/default/role/meta/main.yml.j2 +0 -18
- ansible/galaxy/data/network/cliconf_plugins/example.py.j2 +1 -2
- ansible/galaxy/data/network/library/example_command.py.j2 +1 -2
- ansible/galaxy/data/network/library/example_config.py.j2 +1 -2
- ansible/galaxy/data/network/library/example_facts.py.j2 +1 -2
- ansible/galaxy/data/network/meta/main.yml.j2 +0 -15
- ansible/galaxy/data/network/module_utils/example.py.j2 +1 -2
- ansible/galaxy/data/network/netconf_plugins/example.py.j2 +1 -2
- ansible/galaxy/data/network/terminal_plugins/example.py.j2 +1 -2
- ansible/galaxy/dependency_resolution/__init__.py +1 -2
- ansible/galaxy/dependency_resolution/dataclasses.py +5 -6
- ansible/galaxy/dependency_resolution/errors.py +1 -2
- ansible/galaxy/dependency_resolution/providers.py +3 -4
- ansible/galaxy/dependency_resolution/reporters.py +2 -3
- ansible/galaxy/dependency_resolution/resolvers.py +1 -2
- ansible/galaxy/dependency_resolution/versioning.py +1 -2
- ansible/galaxy/role.py +2 -3
- ansible/galaxy/token.py +1 -2
- ansible/galaxy/user_agent.py +1 -2
- ansible/inventory/data.py +1 -2
- ansible/inventory/group.py +1 -2
- ansible/inventory/helpers.py +1 -2
- ansible/inventory/host.py +1 -3
- ansible/inventory/manager.py +1 -2
- ansible/module_utils/_text.py +1 -2
- ansible/module_utils/ansible_release.py +3 -5
- ansible/module_utils/api.py +1 -2
- ansible/module_utils/basic.py +113 -158
- ansible/module_utils/common/_collections_compat.py +1 -2
- ansible/module_utils/common/_utils.py +1 -3
- ansible/module_utils/common/arg_spec.py +1 -2
- ansible/module_utils/common/collections.py +1 -2
- ansible/module_utils/common/dict_transformations.py +1 -2
- ansible/module_utils/common/file.py +10 -5
- ansible/module_utils/common/json.py +1 -3
- ansible/module_utils/common/locale.py +1 -2
- ansible/module_utils/common/network.py +2 -3
- ansible/module_utils/common/parameters.py +9 -9
- ansible/module_utils/common/process.py +12 -5
- ansible/module_utils/common/respawn.py +2 -3
- ansible/module_utils/common/sys_info.py +1 -2
- ansible/module_utils/common/text/converters.py +1 -2
- ansible/module_utils/common/text/formatters.py +1 -2
- ansible/module_utils/common/validation.py +5 -6
- ansible/module_utils/common/warnings.py +1 -2
- ansible/module_utils/common/yaml.py +1 -2
- ansible/module_utils/compat/datetime.py +1 -3
- ansible/module_utils/compat/importlib.py +21 -13
- ansible/module_utils/compat/paramiko.py +1 -2
- ansible/module_utils/compat/selectors.py +10 -34
- ansible/module_utils/compat/selinux.py +1 -2
- ansible/module_utils/compat/typing.py +1 -2
- ansible/module_utils/compat/version.py +1 -2
- ansible/module_utils/connection.py +1 -2
- ansible/module_utils/csharp/Ansible.Basic.cs +20 -3
- ansible/module_utils/distro/__init__.py +3 -4
- ansible/module_utils/distro/_distro.py +230 -234
- ansible/module_utils/errors.py +1 -2
- ansible/module_utils/facts/__init__.py +1 -2
- ansible/module_utils/facts/ansible_collector.py +1 -2
- ansible/module_utils/facts/collector.py +1 -2
- ansible/module_utils/facts/compat.py +1 -2
- ansible/module_utils/facts/default_collectors.py +1 -2
- ansible/module_utils/facts/hardware/aix.py +1 -2
- ansible/module_utils/facts/hardware/base.py +1 -2
- ansible/module_utils/facts/hardware/darwin.py +1 -2
- ansible/module_utils/facts/hardware/dragonfly.py +1 -2
- ansible/module_utils/facts/hardware/freebsd.py +1 -2
- ansible/module_utils/facts/hardware/hpux.py +1 -2
- ansible/module_utils/facts/hardware/hurd.py +1 -2
- ansible/module_utils/facts/hardware/linux.py +8 -6
- ansible/module_utils/facts/hardware/netbsd.py +1 -2
- ansible/module_utils/facts/hardware/openbsd.py +1 -2
- ansible/module_utils/facts/hardware/sunos.py +2 -3
- ansible/module_utils/facts/namespace.py +1 -2
- ansible/module_utils/facts/network/aix.py +1 -2
- ansible/module_utils/facts/network/base.py +1 -2
- ansible/module_utils/facts/network/darwin.py +1 -2
- ansible/module_utils/facts/network/dragonfly.py +1 -2
- ansible/module_utils/facts/network/fc_wwn.py +1 -2
- ansible/module_utils/facts/network/freebsd.py +1 -2
- ansible/module_utils/facts/network/generic_bsd.py +1 -2
- ansible/module_utils/facts/network/hpux.py +1 -2
- ansible/module_utils/facts/network/hurd.py +1 -2
- ansible/module_utils/facts/network/iscsi.py +1 -2
- ansible/module_utils/facts/network/linux.py +1 -2
- ansible/module_utils/facts/network/netbsd.py +1 -2
- ansible/module_utils/facts/network/nvme.py +1 -2
- ansible/module_utils/facts/network/openbsd.py +1 -2
- ansible/module_utils/facts/network/sunos.py +1 -2
- ansible/module_utils/facts/other/facter.py +1 -2
- ansible/module_utils/facts/other/ohai.py +1 -2
- ansible/module_utils/facts/packages.py +1 -2
- ansible/module_utils/facts/sysctl.py +1 -2
- ansible/module_utils/facts/system/apparmor.py +1 -2
- ansible/module_utils/facts/system/caps.py +1 -2
- ansible/module_utils/facts/system/chroot.py +1 -2
- ansible/module_utils/facts/system/cmdline.py +1 -2
- ansible/module_utils/facts/system/date_time.py +1 -2
- ansible/module_utils/facts/system/distribution.py +4 -5
- ansible/module_utils/facts/system/dns.py +1 -2
- ansible/module_utils/facts/system/env.py +1 -2
- ansible/module_utils/facts/system/fips.py +1 -2
- ansible/module_utils/facts/system/loadavg.py +1 -2
- ansible/module_utils/facts/system/local.py +1 -2
- ansible/module_utils/facts/system/lsb.py +1 -2
- ansible/module_utils/facts/system/pkg_mgr.py +7 -30
- ansible/module_utils/facts/system/platform.py +1 -2
- ansible/module_utils/facts/system/python.py +1 -2
- ansible/module_utils/facts/system/selinux.py +1 -2
- ansible/module_utils/facts/system/service_mgr.py +1 -2
- ansible/module_utils/facts/system/ssh_pub_keys.py +1 -2
- ansible/module_utils/facts/system/user.py +1 -2
- ansible/module_utils/facts/timeout.py +1 -2
- ansible/module_utils/facts/utils.py +1 -2
- ansible/module_utils/facts/virtual/base.py +1 -2
- ansible/module_utils/facts/virtual/dragonfly.py +1 -2
- ansible/module_utils/facts/virtual/freebsd.py +1 -2
- ansible/module_utils/facts/virtual/hpux.py +1 -2
- ansible/module_utils/facts/virtual/linux.py +1 -2
- ansible/module_utils/facts/virtual/netbsd.py +1 -2
- ansible/module_utils/facts/virtual/openbsd.py +1 -2
- ansible/module_utils/facts/virtual/sunos.py +1 -2
- ansible/module_utils/facts/virtual/sysctl.py +1 -2
- ansible/module_utils/json_utils.py +1 -2
- ansible/module_utils/parsing/convert_bool.py +1 -2
- ansible/module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1 +5 -2
- ansible/module_utils/powershell/Ansible.ModuleUtils.WebRequest.psm1 +1 -1
- ansible/module_utils/pycompat24.py +24 -4
- ansible/module_utils/service.py +31 -5
- ansible/module_utils/six/__init__.py +1 -1
- ansible/module_utils/splitter.py +1 -2
- ansible/module_utils/urls.py +335 -1052
- ansible/module_utils/yumdnf.py +13 -35
- ansible/modules/add_host.py +1 -2
- ansible/modules/apt.py +38 -22
- ansible/modules/apt_key.py +1 -2
- ansible/modules/apt_repository.py +18 -10
- ansible/modules/assemble.py +1 -2
- ansible/modules/assert.py +8 -4
- ansible/modules/async_status.py +17 -14
- ansible/modules/async_wrapper.py +11 -9
- ansible/modules/blockinfile.py +2 -3
- ansible/modules/command.py +1 -2
- ansible/modules/copy.py +4 -76
- ansible/modules/cron.py +3 -3
- ansible/modules/deb822_repository.py +5 -5
- ansible/modules/debconf.py +19 -8
- ansible/modules/debug.py +1 -2
- ansible/modules/dnf.py +39 -46
- ansible/modules/dnf5.py +28 -26
- ansible/modules/dpkg_selections.py +1 -2
- ansible/modules/expect.py +23 -15
- ansible/modules/fail.py +1 -2
- ansible/modules/fetch.py +1 -2
- ansible/modules/file.py +4 -3
- ansible/modules/find.py +18 -5
- ansible/modules/gather_facts.py +1 -2
- ansible/modules/get_url.py +2 -3
- ansible/modules/getent.py +2 -3
- ansible/modules/git.py +28 -17
- ansible/modules/group.py +1 -2
- ansible/modules/group_by.py +1 -2
- ansible/modules/hostname.py +2 -19
- ansible/modules/import_playbook.py +1 -2
- ansible/modules/import_role.py +9 -2
- ansible/modules/import_tasks.py +1 -2
- ansible/modules/include_role.py +1 -2
- ansible/modules/include_tasks.py +1 -2
- ansible/modules/include_vars.py +1 -2
- ansible/modules/iptables.py +38 -21
- ansible/modules/known_hosts.py +15 -8
- ansible/modules/lineinfile.py +1 -6
- ansible/modules/meta.py +3 -2
- ansible/modules/package.py +6 -5
- ansible/modules/package_facts.py +1 -2
- ansible/modules/pause.py +2 -3
- ansible/modules/ping.py +1 -2
- ansible/modules/pip.py +40 -20
- ansible/modules/raw.py +1 -2
- ansible/modules/reboot.py +1 -2
- ansible/modules/replace.py +7 -5
- ansible/modules/rpm_key.py +1 -2
- ansible/modules/script.py +1 -2
- ansible/modules/service.py +3 -21
- ansible/modules/service_facts.py +3 -12
- ansible/modules/set_fact.py +1 -2
- ansible/modules/set_stats.py +1 -2
- ansible/modules/setup.py +1 -2
- ansible/modules/shell.py +1 -2
- ansible/modules/slurp.py +1 -2
- ansible/modules/stat.py +1 -2
- ansible/modules/subversion.py +2 -3
- ansible/modules/systemd.py +12 -9
- ansible/modules/systemd_service.py +12 -9
- ansible/modules/sysvinit.py +7 -2
- ansible/modules/tempfile.py +7 -2
- ansible/modules/template.py +2 -3
- ansible/modules/unarchive.py +13 -3
- ansible/modules/uri.py +12 -15
- ansible/modules/user.py +11 -4
- ansible/modules/validate_argument_spec.py +15 -16
- ansible/modules/wait_for.py +1 -2
- ansible/modules/wait_for_connection.py +1 -2
- ansible/modules/yum_repository.py +2 -3
- ansible/parsing/__init__.py +1 -3
- ansible/parsing/ajson.py +1 -3
- ansible/parsing/dataloader.py +23 -12
- ansible/parsing/mod_args.py +6 -4
- ansible/parsing/plugin_docs.py +1 -2
- ansible/parsing/quoting.py +1 -3
- ansible/parsing/splitter.py +1 -3
- ansible/parsing/utils/__init__.py +1 -3
- ansible/parsing/utils/addresses.py +1 -3
- ansible/parsing/utils/jsonify.py +1 -3
- ansible/parsing/utils/yaml.py +1 -3
- ansible/parsing/vault/__init__.py +6 -8
- ansible/parsing/yaml/__init__.py +1 -3
- ansible/parsing/yaml/constructor.py +1 -3
- ansible/parsing/yaml/dumper.py +1 -3
- ansible/parsing/yaml/loader.py +1 -3
- ansible/parsing/yaml/objects.py +1 -3
- ansible/playbook/__init__.py +1 -3
- ansible/playbook/attribute.py +1 -3
- ansible/playbook/base.py +2 -3
- ansible/playbook/block.py +1 -3
- ansible/playbook/collectionsearch.py +1 -2
- ansible/playbook/conditional.py +1 -3
- ansible/playbook/delegatable.py +1 -0
- ansible/playbook/handler.py +2 -4
- ansible/playbook/handler_task_include.py +1 -3
- ansible/playbook/helpers.py +1 -4
- ansible/playbook/included_file.py +4 -4
- ansible/playbook/loop_control.py +1 -3
- ansible/playbook/notifiable.py +1 -0
- ansible/playbook/play.py +1 -3
- ansible/playbook/play_context.py +1 -3
- ansible/playbook/playbook_include.py +1 -3
- ansible/playbook/role/__init__.py +1 -3
- ansible/playbook/role/definition.py +1 -3
- ansible/playbook/role/include.py +1 -3
- ansible/playbook/role/metadata.py +1 -3
- ansible/playbook/role/requirement.py +1 -3
- ansible/playbook/role_include.py +2 -10
- ansible/playbook/taggable.py +1 -3
- ansible/playbook/task.py +2 -4
- ansible/playbook/task_include.py +1 -3
- ansible/plugins/__init__.py +4 -5
- ansible/plugins/action/__init__.py +19 -13
- ansible/plugins/action/add_host.py +2 -4
- ansible/plugins/action/assemble.py +2 -3
- ansible/plugins/action/assert.py +1 -2
- ansible/plugins/action/async_status.py +1 -2
- ansible/plugins/action/command.py +1 -2
- ansible/plugins/action/copy.py +12 -9
- ansible/plugins/action/debug.py +1 -2
- ansible/plugins/action/dnf.py +4 -4
- ansible/plugins/action/fail.py +1 -2
- ansible/plugins/action/fetch.py +2 -3
- ansible/plugins/action/gather_facts.py +3 -4
- ansible/plugins/action/group_by.py +1 -2
- ansible/plugins/action/include_vars.py +1 -2
- ansible/plugins/action/normal.py +1 -2
- ansible/plugins/action/package.py +36 -21
- ansible/plugins/action/pause.py +1 -2
- ansible/plugins/action/raw.py +2 -3
- ansible/plugins/action/reboot.py +30 -15
- ansible/plugins/action/script.py +3 -4
- ansible/plugins/action/service.py +1 -2
- ansible/plugins/action/set_fact.py +1 -2
- ansible/plugins/action/set_stats.py +1 -2
- ansible/plugins/action/shell.py +1 -2
- ansible/plugins/action/template.py +1 -2
- ansible/plugins/action/unarchive.py +1 -2
- ansible/plugins/action/uri.py +2 -3
- ansible/plugins/action/validate_argument_spec.py +1 -2
- ansible/plugins/action/wait_for_connection.py +2 -3
- ansible/plugins/become/__init__.py +1 -2
- ansible/plugins/become/runas.py +1 -2
- ansible/plugins/become/su.py +1 -2
- ansible/plugins/become/sudo.py +1 -2
- ansible/plugins/cache/__init__.py +3 -3
- ansible/plugins/cache/base.py +1 -2
- ansible/plugins/cache/jsonfile.py +1 -3
- ansible/plugins/cache/memory.py +1 -2
- ansible/plugins/callback/__init__.py +2 -4
- ansible/plugins/callback/default.py +2 -3
- ansible/plugins/callback/junit.py +1 -2
- ansible/plugins/callback/minimal.py +1 -3
- ansible/plugins/callback/oneline.py +1 -3
- ansible/plugins/callback/tree.py +1 -2
- ansible/plugins/cliconf/__init__.py +1 -2
- ansible/plugins/connection/__init__.py +4 -5
- ansible/plugins/connection/local.py +3 -4
- ansible/plugins/connection/paramiko_ssh.py +1 -2
- ansible/plugins/connection/psrp.py +1 -2
- ansible/plugins/connection/ssh.py +18 -54
- ansible/plugins/connection/winrm.py +3 -4
- ansible/plugins/doc_fragments/action_common_attributes.py +2 -3
- ansible/plugins/doc_fragments/action_core.py +3 -4
- ansible/plugins/doc_fragments/backup.py +1 -2
- ansible/plugins/doc_fragments/connection_pipelining.py +1 -2
- ansible/plugins/doc_fragments/constructed.py +1 -2
- ansible/plugins/doc_fragments/decrypt.py +2 -3
- ansible/plugins/doc_fragments/default_callback.py +1 -2
- ansible/plugins/doc_fragments/files.py +1 -2
- ansible/plugins/doc_fragments/inventory_cache.py +1 -2
- ansible/plugins/doc_fragments/result_format_callback.py +1 -2
- ansible/plugins/doc_fragments/return_common.py +1 -2
- ansible/plugins/doc_fragments/shell_common.py +1 -2
- ansible/plugins/doc_fragments/shell_windows.py +1 -2
- ansible/plugins/doc_fragments/template_common.py +1 -2
- ansible/plugins/doc_fragments/url.py +1 -2
- ansible/plugins/doc_fragments/url_windows.py +1 -2
- ansible/plugins/doc_fragments/validate.py +1 -2
- ansible/plugins/doc_fragments/vars_plugin_staging.py +1 -2
- ansible/plugins/filter/__init__.py +1 -2
- ansible/plugins/filter/b64decode.yml +8 -8
- ansible/plugins/filter/b64encode.yml +4 -4
- ansible/plugins/filter/comment.yml +1 -1
- ansible/plugins/filter/core.py +11 -9
- ansible/plugins/filter/encryption.py +1 -3
- ansible/plugins/filter/extract.yml +1 -1
- ansible/plugins/filter/from_yaml_all.yml +1 -1
- ansible/plugins/filter/human_readable.yml +3 -3
- ansible/plugins/filter/human_to_bytes.yml +2 -2
- ansible/plugins/filter/mandatory.yml +1 -1
- ansible/plugins/filter/mathstuff.py +2 -2
- ansible/plugins/filter/password_hash.yml +3 -2
- ansible/plugins/filter/regex_replace.yml +15 -0
- ansible/plugins/filter/regex_search.yml +12 -0
- ansible/plugins/filter/strftime.yml +2 -9
- ansible/plugins/filter/to_datetime.yml +17 -2
- ansible/plugins/filter/to_nice_json.yml +4 -0
- ansible/plugins/filter/union.yml +1 -1
- ansible/plugins/filter/urls.py +1 -2
- ansible/plugins/filter/urlsplit.py +1 -2
- ansible/plugins/filter/zip.yml +2 -2
- ansible/plugins/filter/zip_longest.yml +1 -1
- ansible/plugins/httpapi/__init__.py +1 -2
- ansible/plugins/inventory/__init__.py +2 -4
- ansible/plugins/inventory/advanced_host_list.py +1 -2
- ansible/plugins/inventory/auto.py +2 -3
- ansible/plugins/inventory/constructed.py +3 -2
- ansible/plugins/inventory/generator.py +1 -2
- ansible/plugins/inventory/host_list.py +1 -2
- ansible/plugins/inventory/ini.py +1 -2
- ansible/plugins/inventory/script.py +122 -3
- ansible/plugins/inventory/toml.py +1 -2
- ansible/plugins/inventory/yaml.py +3 -4
- ansible/plugins/list.py +2 -3
- ansible/plugins/loader.py +10 -11
- ansible/plugins/lookup/__init__.py +1 -3
- ansible/plugins/lookup/config.py +19 -15
- ansible/plugins/lookup/csvfile.py +16 -7
- ansible/plugins/lookup/dict.py +2 -3
- ansible/plugins/lookup/env.py +4 -4
- ansible/plugins/lookup/file.py +1 -2
- ansible/plugins/lookup/fileglob.py +1 -2
- ansible/plugins/lookup/first_found.py +8 -7
- ansible/plugins/lookup/indexed_items.py +1 -2
- ansible/plugins/lookup/ini.py +6 -3
- ansible/plugins/lookup/inventory_hostnames.py +1 -2
- ansible/plugins/lookup/items.py +1 -2
- ansible/plugins/lookup/lines.py +1 -2
- ansible/plugins/lookup/list.py +1 -3
- ansible/plugins/lookup/nested.py +1 -2
- ansible/plugins/lookup/password.py +16 -14
- ansible/plugins/lookup/pipe.py +1 -2
- ansible/plugins/lookup/random_choice.py +1 -2
- ansible/plugins/lookup/sequence.py +21 -52
- ansible/plugins/lookup/subelements.py +1 -2
- ansible/plugins/lookup/template.py +1 -2
- ansible/plugins/lookup/together.py +1 -2
- ansible/plugins/lookup/unvault.py +1 -2
- ansible/plugins/lookup/url.py +9 -11
- ansible/plugins/lookup/varnames.py +1 -2
- ansible/plugins/lookup/vars.py +1 -2
- ansible/plugins/netconf/__init__.py +1 -2
- ansible/plugins/shell/__init__.py +3 -4
- ansible/plugins/shell/cmd.py +1 -2
- ansible/plugins/shell/powershell.py +1 -2
- ansible/plugins/shell/sh.py +1 -2
- ansible/plugins/strategy/__init__.py +33 -21
- ansible/plugins/strategy/debug.py +1 -2
- ansible/plugins/strategy/free.py +17 -7
- ansible/plugins/strategy/host_pinned.py +1 -3
- ansible/plugins/strategy/linear.py +22 -22
- ansible/plugins/terminal/__init__.py +2 -3
- ansible/plugins/test/__init__.py +1 -2
- ansible/plugins/test/change.yml +1 -1
- ansible/plugins/test/changed.yml +1 -1
- ansible/plugins/test/contains.yml +1 -1
- ansible/plugins/test/core.py +2 -4
- ansible/plugins/test/exists.yml +1 -1
- ansible/plugins/test/failed.yml +1 -1
- ansible/plugins/test/failure.yml +1 -1
- ansible/plugins/test/files.py +1 -3
- ansible/plugins/test/finished.yml +3 -3
- ansible/plugins/test/issuperset.yml +1 -1
- ansible/plugins/test/match.yml +1 -1
- ansible/plugins/test/mathstuff.py +1 -2
- ansible/plugins/test/reachable.yml +1 -1
- ansible/plugins/test/regex.yml +1 -1
- ansible/plugins/test/search.yml +1 -1
- ansible/plugins/test/skip.yml +1 -1
- ansible/plugins/test/skipped.yml +1 -1
- ansible/plugins/test/started.yml +1 -1
- ansible/plugins/test/succeeded.yml +1 -1
- ansible/plugins/test/success.yml +1 -1
- ansible/plugins/test/successful.yml +1 -1
- ansible/plugins/test/superset.yml +1 -1
- ansible/plugins/test/unreachable.yml +1 -1
- ansible/plugins/test/uri.py +1 -3
- ansible/plugins/vars/__init__.py +1 -2
- ansible/plugins/vars/host_group_vars.py +2 -3
- ansible/release.py +3 -5
- ansible/template/__init__.py +14 -27
- ansible/template/native_helpers.py +1 -3
- ansible/template/template.py +1 -3
- ansible/template/vars.py +1 -0
- ansible/utils/__init__.py +1 -3
- ansible/utils/cmd_functions.py +1 -2
- ansible/utils/collection_loader/__init__.py +1 -2
- ansible/utils/collection_loader/_collection_config.py +1 -2
- ansible/utils/collection_loader/_collection_finder.py +1 -2
- ansible/utils/collection_loader/_collection_meta.py +1 -2
- ansible/utils/color.py +1 -2
- ansible/utils/context_objects.py +1 -4
- ansible/utils/display.py +89 -30
- ansible/utils/encrypt.py +4 -105
- ansible/utils/fqcn.py +1 -2
- ansible/utils/galaxy.py +1 -3
- ansible/utils/hashing.py +1 -3
- ansible/utils/helpers.py +1 -3
- ansible/utils/jsonrpc.py +1 -2
- ansible/utils/listify.py +1 -3
- ansible/utils/lock.py +1 -3
- ansible/utils/multiprocessing.py +1 -3
- ansible/utils/native_jinja.py +1 -3
- ansible/utils/path.py +1 -2
- ansible/utils/plugin_docs.py +7 -6
- ansible/utils/py3compat.py +17 -55
- ansible/utils/sentinel.py +1 -3
- ansible/utils/shlex.py +1 -3
- ansible/utils/singleton.py +1 -3
- ansible/utils/ssh_functions.py +1 -3
- ansible/utils/unicode.py +1 -3
- ansible/utils/unsafe_proxy.py +1 -2
- ansible/utils/vars.py +6 -8
- ansible/utils/version.py +1 -3
- ansible/vars/clean.py +1 -3
- ansible/vars/fact_cache.py +1 -2
- ansible/vars/hostvars.py +3 -7
- ansible/vars/manager.py +24 -6
- ansible/vars/reserved.py +1 -3
- {ansible_core-2.16.7.data → ansible_core-2.17.0.data}/scripts/ansible-test +1 -2
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/METADATA +3 -3
- ansible_core-2.17.0.dist-info/RECORD +987 -0
- ansible_test/__init__.py +1 -2
- ansible_test/_data/completion/docker.txt +7 -9
- ansible_test/_data/completion/remote.txt +6 -7
- ansible_test/_data/requirements/ansible-test.txt +0 -2
- ansible_test/_data/requirements/constraints.txt +1 -6
- ansible_test/_data/requirements/sanity.ansible-doc.txt +3 -3
- ansible_test/_data/requirements/sanity.changelog.txt +3 -3
- ansible_test/_data/requirements/sanity.import.plugin.txt +2 -2
- ansible_test/_data/requirements/sanity.mypy.txt +12 -12
- ansible_test/_data/requirements/sanity.pep8.txt +1 -1
- ansible_test/_data/requirements/sanity.pylint.txt +7 -7
- ansible_test/_data/requirements/sanity.runtime-metadata.txt +1 -1
- ansible_test/_data/requirements/sanity.validate-modules.txt +3 -3
- ansible_test/_data/requirements/sanity.yamllint.txt +2 -2
- ansible_test/_internal/bootstrap.py +2 -2
- ansible_test/_internal/classification/__init__.py +0 -5
- ansible_test/_internal/commands/integration/cloud/cs.py +1 -1
- ansible_test/_internal/commands/integration/cloud/nios.py +1 -1
- ansible_test/_internal/commands/sanity/__init__.py +1 -27
- ansible_test/_internal/commands/sanity/import.py +0 -18
- ansible_test/_internal/commands/sanity/mypy.py +7 -10
- ansible_test/_internal/commands/units/__init__.py +1 -1
- ansible_test/_internal/config.py +0 -1
- ansible_test/_internal/content_config.py +0 -5
- ansible_test/_internal/coverage_util.py +0 -1
- ansible_test/_internal/docker_util.py +1 -1
- ansible_test/_internal/host_profiles.py +5 -4
- ansible_test/_internal/pypi_proxy.py +1 -8
- ansible_test/_internal/python_requirements.py +1 -119
- ansible_test/_internal/ssh.py +1 -0
- ansible_test/_internal/util.py +1 -1
- ansible_test/_internal/util_common.py +1 -1
- ansible_test/_internal/venv.py +10 -108
- ansible_test/_util/__init__.py +1 -2
- ansible_test/_util/controller/sanity/mypy/ansible-core.ini +0 -6
- ansible_test/_util/controller/sanity/mypy/modules.ini +0 -6
- ansible_test/_util/controller/sanity/pylint/config/ansible-test-target.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/ansible-test.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/code-smell.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/collection.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/default.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py +1 -2
- ansible_test/_util/controller/sanity/shellcheck/exclude.txt +0 -1
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py +31 -59
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/module_args.py +0 -7
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py +10 -2
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/utils.py +1 -1
- ansible_test/_util/controller/sanity/yamllint/yamllinter.py +16 -4
- ansible_test/_util/target/__init__.py +1 -2
- ansible_test/_util/target/cli/ansible_test_cli_stub.py +1 -2
- ansible_test/_util/target/common/constants.py +1 -4
- ansible_test/_util/target/injector/python.py +4 -19
- ansible_test/_util/target/pytest/plugins/ansible_forked.py +2 -9
- ansible_test/_util/target/pytest/plugins/ansible_pytest_collections.py +1 -5
- ansible_test/_util/target/pytest/plugins/ansible_pytest_coverage.py +1 -2
- ansible_test/_util/target/sanity/compile/compile.py +3 -12
- ansible_test/_util/target/sanity/import/importer.py +1 -12
- ansible_test/_util/target/setup/bootstrap.sh +49 -105
- ansible_test/_util/target/setup/probe_cgroups.py +1 -2
- ansible_test/_util/target/setup/quiet_pip.py +1 -16
- ansible_test/_util/target/setup/requirements.py +9 -2
- ansible_test/_util/target/tools/virtualenvcheck.py +1 -2
- ansible_test/_util/target/tools/yamlcheck.py +1 -2
- ansible/module_utils/common/_json_compat.py +0 -16
- ansible/module_utils/compat/_selectors2.py +0 -655
- ansible/modules/yum.py +0 -1821
- ansible/plugins/action/yum.py +0 -111
- ansible_core-2.16.7.dist-info/RECORD +0 -1009
- ansible_test/_util/controller/sanity/code-smell/future-import-boilerplate.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/future-import-boilerplate.py +0 -46
- ansible_test/_util/controller/sanity/code-smell/metaclass-boilerplate.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/metaclass-boilerplate.py +0 -44
- ansible_test/_util/controller/sanity/code-smell/no-basestring.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-basestring.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-dict-iteritems.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-dict-iteritems.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-dict-iterkeys.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-dict-iterkeys.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-dict-itervalues.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-dict-itervalues.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-main-display.json +0 -10
- ansible_test/_util/controller/sanity/code-smell/no-main-display.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.py +0 -21
- ansible_test/_util/controller/tools/sslcheck.py +0 -22
- ansible_test/_util/target/common/__init__.py +0 -2
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/COPYING +0 -0
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/WHEEL +0 -0
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/entry_points.txt +0 -0
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/top_level.txt +0 -0
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
"""Installed collections management package."""
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
import errno
|
|
10
9
|
import fnmatch
|
|
11
10
|
import functools
|
|
11
|
+
import inspect
|
|
12
12
|
import json
|
|
13
13
|
import os
|
|
14
14
|
import pathlib
|
|
@@ -26,7 +26,7 @@ import typing as t
|
|
|
26
26
|
|
|
27
27
|
from collections import namedtuple
|
|
28
28
|
from contextlib import contextmanager
|
|
29
|
-
from dataclasses import dataclass
|
|
29
|
+
from dataclasses import dataclass
|
|
30
30
|
from hashlib import sha256
|
|
31
31
|
from io import BytesIO
|
|
32
32
|
from importlib.metadata import distribution
|
|
@@ -124,6 +124,7 @@ from ansible.galaxy.dependency_resolution.dataclasses import (
|
|
|
124
124
|
)
|
|
125
125
|
from ansible.galaxy.dependency_resolution.versioning import meets_requirements
|
|
126
126
|
from ansible.plugins.loader import get_all_plugin_loaders
|
|
127
|
+
from ansible.module_utils.common.file import S_IRWU_RG_RO, S_IRWXU_RXG_RXO, S_IXANY
|
|
127
128
|
from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
|
|
128
129
|
from ansible.module_utils.common.collections import is_sequence
|
|
129
130
|
from ansible.module_utils.common.yaml import yaml_dump
|
|
@@ -152,9 +153,9 @@ class ManifestControl:
|
|
|
152
153
|
# Allow a dict representing this dataclass to be splatted directly.
|
|
153
154
|
# Requires attrs to have a default value, so anything with a default
|
|
154
155
|
# of None is swapped for its, potentially mutable, default
|
|
155
|
-
for
|
|
156
|
-
if getattr(self,
|
|
157
|
-
super().__setattr__(
|
|
156
|
+
for field_name, field_type in inspect.get_annotations(type(self), eval_str=True).items():
|
|
157
|
+
if getattr(self, field_name) is None:
|
|
158
|
+
super().__setattr__(field_name, field_type())
|
|
158
159
|
|
|
159
160
|
|
|
160
161
|
class CollectionSignatureError(Exception):
|
|
@@ -333,11 +334,18 @@ def verify_local_collection(local_collection, remote_collection, artifacts_manag
|
|
|
333
334
|
os.path.join(b_collection_path, to_bytes(name, errors='surrogate_or_strict'))
|
|
334
335
|
)
|
|
335
336
|
|
|
337
|
+
b_ignore_patterns = [
|
|
338
|
+
b'*.pyc',
|
|
339
|
+
]
|
|
340
|
+
|
|
336
341
|
# Find any paths not in the FILES.json
|
|
337
342
|
for root, dirs, files in os.walk(b_collection_path):
|
|
338
343
|
for name in files:
|
|
339
344
|
full_path = os.path.join(root, name)
|
|
340
345
|
path = to_text(full_path[len(b_collection_path) + 1::], errors='surrogate_or_strict')
|
|
346
|
+
if any(fnmatch.fnmatch(full_path, b_pattern) for b_pattern in b_ignore_patterns):
|
|
347
|
+
display.v("Ignoring verification for %s" % full_path)
|
|
348
|
+
continue
|
|
341
349
|
|
|
342
350
|
if full_path not in collection_files:
|
|
343
351
|
modified_content.append(
|
|
@@ -544,7 +552,7 @@ def download_collections(
|
|
|
544
552
|
for fqcn, concrete_coll_pin in dep_map.copy().items(): # FIXME: move into the provider
|
|
545
553
|
if concrete_coll_pin.is_virtual:
|
|
546
554
|
display.display(
|
|
547
|
-
'
|
|
555
|
+
'{coll!s} is not downloadable'.
|
|
548
556
|
format(coll=to_text(concrete_coll_pin)),
|
|
549
557
|
)
|
|
550
558
|
continue
|
|
@@ -741,7 +749,7 @@ def install_collections(
|
|
|
741
749
|
for fqcn, concrete_coll_pin in dependency_map.items():
|
|
742
750
|
if concrete_coll_pin.is_virtual:
|
|
743
751
|
display.vvvv(
|
|
744
|
-
"
|
|
752
|
+
"Encountered {coll!s}, skipping.".
|
|
745
753
|
format(coll=to_text(concrete_coll_pin)),
|
|
746
754
|
)
|
|
747
755
|
continue
|
|
@@ -1203,10 +1211,17 @@ def _build_files_manifest_walk(b_collection_path, namespace, name, ignore_patter
|
|
|
1203
1211
|
|
|
1204
1212
|
manifest = _make_manifest()
|
|
1205
1213
|
|
|
1214
|
+
def _discover_relative_base_directory(b_path: bytes, b_top_level_dir: bytes) -> bytes:
|
|
1215
|
+
if b_path == b_top_level_dir:
|
|
1216
|
+
return b''
|
|
1217
|
+
common_prefix = os.path.commonpath((b_top_level_dir, b_path))
|
|
1218
|
+
b_rel_base_dir = os.path.relpath(b_path, common_prefix)
|
|
1219
|
+
return b_rel_base_dir.lstrip(os.path.sep.encode())
|
|
1220
|
+
|
|
1206
1221
|
def _walk(b_path, b_top_level_dir):
|
|
1222
|
+
b_rel_base_dir = _discover_relative_base_directory(b_path, b_top_level_dir)
|
|
1207
1223
|
for b_item in os.listdir(b_path):
|
|
1208
1224
|
b_abs_path = os.path.join(b_path, b_item)
|
|
1209
|
-
b_rel_base_dir = b'' if b_path == b_top_level_dir else b_path[len(b_top_level_dir) + 1:]
|
|
1210
1225
|
b_rel_path = os.path.join(b_rel_base_dir, b_item)
|
|
1211
1226
|
rel_path = to_text(b_rel_path, errors='surrogate_or_strict')
|
|
1212
1227
|
|
|
@@ -1303,7 +1318,7 @@ def _build_collection_tar(
|
|
|
1303
1318
|
tar_info = tarfile.TarInfo(name)
|
|
1304
1319
|
tar_info.size = len(b)
|
|
1305
1320
|
tar_info.mtime = int(time.time())
|
|
1306
|
-
tar_info.mode =
|
|
1321
|
+
tar_info.mode = S_IRWU_RG_RO
|
|
1307
1322
|
tar_file.addfile(tarinfo=tar_info, fileobj=b_io)
|
|
1308
1323
|
|
|
1309
1324
|
for file_info in file_manifest['files']: # type: ignore[union-attr]
|
|
@@ -1317,7 +1332,7 @@ def _build_collection_tar(
|
|
|
1317
1332
|
def reset_stat(tarinfo):
|
|
1318
1333
|
if tarinfo.type != tarfile.SYMTYPE:
|
|
1319
1334
|
existing_is_exec = tarinfo.mode & stat.S_IXUSR
|
|
1320
|
-
tarinfo.mode =
|
|
1335
|
+
tarinfo.mode = S_IRWXU_RXG_RXO if existing_is_exec or tarinfo.isdir() else S_IRWU_RG_RO
|
|
1321
1336
|
tarinfo.uid = tarinfo.gid = 0
|
|
1322
1337
|
tarinfo.uname = tarinfo.gname = ''
|
|
1323
1338
|
|
|
@@ -1359,7 +1374,7 @@ def _build_collection_dir(b_collection_path, b_collection_output, collection_man
|
|
|
1359
1374
|
|
|
1360
1375
|
This should follow the same pattern as _build_collection_tar.
|
|
1361
1376
|
"""
|
|
1362
|
-
os.makedirs(b_collection_output, mode=
|
|
1377
|
+
os.makedirs(b_collection_output, mode=S_IRWXU_RXG_RXO)
|
|
1363
1378
|
|
|
1364
1379
|
files_manifest_json = to_bytes(json.dumps(file_manifest, indent=True), errors='surrogate_or_strict')
|
|
1365
1380
|
collection_manifest['file_manifest_file']['chksum_sha256'] = secure_hash_s(files_manifest_json, hash_func=sha256)
|
|
@@ -1371,7 +1386,7 @@ def _build_collection_dir(b_collection_path, b_collection_output, collection_man
|
|
|
1371
1386
|
with open(b_path, 'wb') as file_obj, BytesIO(b) as b_io:
|
|
1372
1387
|
shutil.copyfileobj(b_io, file_obj)
|
|
1373
1388
|
|
|
1374
|
-
os.chmod(b_path,
|
|
1389
|
+
os.chmod(b_path, S_IRWU_RG_RO)
|
|
1375
1390
|
|
|
1376
1391
|
base_directories = []
|
|
1377
1392
|
for file_info in sorted(file_manifest['files'], key=lambda x: x['name']):
|
|
@@ -1382,11 +1397,11 @@ def _build_collection_dir(b_collection_path, b_collection_output, collection_man
|
|
|
1382
1397
|
dest_file = os.path.join(b_collection_output, to_bytes(file_info['name'], errors='surrogate_or_strict'))
|
|
1383
1398
|
|
|
1384
1399
|
existing_is_exec = os.stat(src_file, follow_symlinks=False).st_mode & stat.S_IXUSR
|
|
1385
|
-
mode =
|
|
1400
|
+
mode = S_IRWXU_RXG_RXO if existing_is_exec else S_IRWU_RG_RO
|
|
1386
1401
|
|
|
1387
1402
|
# ensure symlinks to dirs are not translated to empty dirs
|
|
1388
1403
|
if os.path.isdir(src_file) and not os.path.islink(src_file):
|
|
1389
|
-
mode =
|
|
1404
|
+
mode = S_IRWXU_RXG_RXO
|
|
1390
1405
|
base_directories.append(src_file)
|
|
1391
1406
|
os.mkdir(dest_file, mode)
|
|
1392
1407
|
else:
|
|
@@ -1535,10 +1550,10 @@ def write_source_metadata(collection, b_collection_path, artifacts_manager):
|
|
|
1535
1550
|
shutil.rmtree(b_info_dir)
|
|
1536
1551
|
|
|
1537
1552
|
try:
|
|
1538
|
-
os.mkdir(b_info_dir, mode=
|
|
1553
|
+
os.mkdir(b_info_dir, mode=S_IRWXU_RXG_RXO)
|
|
1539
1554
|
with open(b_info_dest, mode='w+b') as fd:
|
|
1540
1555
|
fd.write(b_yaml_source_data)
|
|
1541
|
-
os.chmod(b_info_dest,
|
|
1556
|
+
os.chmod(b_info_dest, S_IRWU_RG_RO)
|
|
1542
1557
|
except Exception:
|
|
1543
1558
|
# Ensure we don't leave the dir behind in case of a failure.
|
|
1544
1559
|
if os.path.isdir(b_info_dir):
|
|
@@ -1667,7 +1682,7 @@ def _extract_tar_dir(tar, dirname, b_dest):
|
|
|
1667
1682
|
|
|
1668
1683
|
b_parent_path = os.path.dirname(b_dir_path)
|
|
1669
1684
|
try:
|
|
1670
|
-
os.makedirs(b_parent_path, mode=
|
|
1685
|
+
os.makedirs(b_parent_path, mode=S_IRWXU_RXG_RXO)
|
|
1671
1686
|
except OSError as e:
|
|
1672
1687
|
if e.errno != errno.EEXIST:
|
|
1673
1688
|
raise
|
|
@@ -1682,7 +1697,7 @@ def _extract_tar_dir(tar, dirname, b_dest):
|
|
|
1682
1697
|
|
|
1683
1698
|
else:
|
|
1684
1699
|
if not os.path.isdir(b_dir_path):
|
|
1685
|
-
os.mkdir(b_dir_path,
|
|
1700
|
+
os.mkdir(b_dir_path, S_IRWXU_RXG_RXO)
|
|
1686
1701
|
|
|
1687
1702
|
|
|
1688
1703
|
def _extract_tar_file(tar, filename, b_dest, b_temp_path, expected_hash=None):
|
|
@@ -1708,7 +1723,7 @@ def _extract_tar_file(tar, filename, b_dest, b_temp_path, expected_hash=None):
|
|
|
1708
1723
|
if not os.path.exists(b_parent_dir):
|
|
1709
1724
|
# Seems like Galaxy does not validate if all file entries have a corresponding dir ftype entry. This check
|
|
1710
1725
|
# makes sure we create the parent directory even if it wasn't set in the metadata.
|
|
1711
|
-
os.makedirs(b_parent_dir, mode=
|
|
1726
|
+
os.makedirs(b_parent_dir, mode=S_IRWXU_RXG_RXO)
|
|
1712
1727
|
|
|
1713
1728
|
if tar_member.type == tarfile.SYMTYPE:
|
|
1714
1729
|
b_link_path = to_bytes(tar_member.linkname, errors='surrogate_or_strict')
|
|
@@ -1723,9 +1738,9 @@ def _extract_tar_file(tar, filename, b_dest, b_temp_path, expected_hash=None):
|
|
|
1723
1738
|
|
|
1724
1739
|
# Default to rw-r--r-- and only add execute if the tar file has execute.
|
|
1725
1740
|
tar_member = tar.getmember(to_native(filename, errors='surrogate_or_strict'))
|
|
1726
|
-
new_mode =
|
|
1741
|
+
new_mode = S_IRWU_RG_RO
|
|
1727
1742
|
if stat.S_IMODE(tar_member.mode) & stat.S_IXUSR:
|
|
1728
|
-
new_mode |=
|
|
1743
|
+
new_mode |= S_IXANY
|
|
1729
1744
|
|
|
1730
1745
|
os.chmod(b_dest_filepath, new_mode)
|
|
1731
1746
|
|
|
@@ -1861,8 +1876,7 @@ def _resolve_depenency_map(
|
|
|
1861
1876
|
raise AnsibleError('\n'.join(error_msg_lines)) from dep_exc
|
|
1862
1877
|
except CollectionDependencyInconsistentCandidate as dep_exc:
|
|
1863
1878
|
parents = [
|
|
1864
|
-
|
|
1865
|
-
for p in dep_exc.criterion.iter_parent()
|
|
1879
|
+
str(p) for p in dep_exc.criterion.iter_parent()
|
|
1866
1880
|
if p is not None
|
|
1867
1881
|
]
|
|
1868
1882
|
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
"""Concrete collection candidate management helper module."""
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
import json
|
|
10
9
|
import os
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
"""A facade for interfacing with multiple Galaxy instances."""
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
import typing as t
|
|
10
9
|
|
ansible/galaxy/collection/gpg.py
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
# Copyright: (c) 2022, Ansible Project
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
"""Signature verification helpers."""
|
|
5
|
+
from __future__ import annotations
|
|
5
6
|
|
|
6
7
|
from ansible.errors import AnsibleError
|
|
7
8
|
from ansible.galaxy.user_agent import user_agent
|
|
8
9
|
from ansible.module_utils.urls import open_url
|
|
9
10
|
|
|
10
11
|
import contextlib
|
|
12
|
+
import inspect
|
|
11
13
|
import os
|
|
12
14
|
import subprocess
|
|
13
15
|
import sys
|
|
@@ -136,8 +138,8 @@ class GpgBaseError(Exception):
|
|
|
136
138
|
return ' '.join(cls.__doc__.split())
|
|
137
139
|
|
|
138
140
|
def __post_init__(self):
|
|
139
|
-
for
|
|
140
|
-
super(GpgBaseError, self).__setattr__(
|
|
141
|
+
for field_name, field_type in inspect.get_annotations(type(self), eval_str=True).items():
|
|
142
|
+
super(GpgBaseError, self).__setattr__(field_name, field_type(getattr(self, field_name)))
|
|
141
143
|
|
|
142
144
|
|
|
143
145
|
@frozen_dataclass
|
|
@@ -16,21 +16,6 @@ galaxy_info:
|
|
|
16
16
|
# - CC-BY-4.0
|
|
17
17
|
license: {{ license }}
|
|
18
18
|
|
|
19
|
-
#
|
|
20
|
-
# platforms is a list of platforms, and each platform has a name and a list of versions.
|
|
21
|
-
#
|
|
22
|
-
# platforms:
|
|
23
|
-
# - name: Fedora
|
|
24
|
-
# versions:
|
|
25
|
-
# - all
|
|
26
|
-
# - 25
|
|
27
|
-
# - name: SomePlatform
|
|
28
|
-
# versions:
|
|
29
|
-
# - all
|
|
30
|
-
# - 1.0
|
|
31
|
-
# - 7
|
|
32
|
-
# - 99.99
|
|
33
|
-
|
|
34
19
|
galaxy_tags:
|
|
35
20
|
- apb
|
|
36
21
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
|
@@ -21,24 +21,6 @@ galaxy_info:
|
|
|
21
21
|
# If Ansible is required outside of the build container, provide the minimum version:
|
|
22
22
|
# min_ansible_version:
|
|
23
23
|
|
|
24
|
-
#
|
|
25
|
-
# Provide a list of supported platforms, and for each platform a list of versions.
|
|
26
|
-
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
|
|
27
|
-
# To view available platforms and versions (or releases), visit:
|
|
28
|
-
# https://galaxy.ansible.com/api/v1/platforms/
|
|
29
|
-
#
|
|
30
|
-
# platforms:
|
|
31
|
-
# - name: Fedora
|
|
32
|
-
# versions:
|
|
33
|
-
# - all
|
|
34
|
-
# - 25
|
|
35
|
-
# - name: SomePlatform
|
|
36
|
-
# versions:
|
|
37
|
-
# - all
|
|
38
|
-
# - 1.0
|
|
39
|
-
# - 7
|
|
40
|
-
# - 99.99
|
|
41
|
-
|
|
42
24
|
galaxy_tags:
|
|
43
25
|
- container
|
|
44
26
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
|
@@ -21,24 +21,6 @@ galaxy_info:
|
|
|
21
21
|
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
|
22
22
|
# min_ansible_container_version:
|
|
23
23
|
|
|
24
|
-
#
|
|
25
|
-
# Provide a list of supported platforms, and for each platform a list of versions.
|
|
26
|
-
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
|
|
27
|
-
# To view available platforms and versions (or releases), visit:
|
|
28
|
-
# https://galaxy.ansible.com/api/v1/platforms/
|
|
29
|
-
#
|
|
30
|
-
# platforms:
|
|
31
|
-
# - name: Fedora
|
|
32
|
-
# versions:
|
|
33
|
-
# - all
|
|
34
|
-
# - 25
|
|
35
|
-
# - name: SomePlatform
|
|
36
|
-
# versions:
|
|
37
|
-
# - all
|
|
38
|
-
# - 1.0
|
|
39
|
-
# - 7
|
|
40
|
-
# - 99.99
|
|
41
|
-
|
|
42
24
|
galaxy_tags: []
|
|
43
25
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
|
44
26
|
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
|
17
17
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
#
|
|
19
|
-
from __future__ import
|
|
19
|
+
from __future__ import annotations
|
|
20
20
|
from ansible.errors import AnsibleError
|
|
21
|
-
__metaclass__ = type
|
|
22
21
|
|
|
23
22
|
try:
|
|
24
23
|
from ansible.plugins.cliconf import CliconfBase
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
|
17
17
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
#
|
|
19
|
-
from __future__ import
|
|
19
|
+
from __future__ import annotations
|
|
20
20
|
from ansible.errors import AnsibleError
|
|
21
|
-
__metaclass__ = type
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
### Documentation
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
|
17
17
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
#
|
|
19
|
-
from __future__ import
|
|
19
|
+
from __future__ import annotations
|
|
20
20
|
from ansible.errors import AnsibleError
|
|
21
|
-
__metaclass__ = type
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
### Documentation
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
|
17
17
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
#
|
|
19
|
-
from __future__ import
|
|
19
|
+
from __future__ import annotations
|
|
20
20
|
from ansible.errors import AnsibleError
|
|
21
|
-
__metaclass__ = type
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
### Documentation
|
|
@@ -21,21 +21,6 @@ galaxy_info:
|
|
|
21
21
|
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
|
22
22
|
# min_ansible_container_version:
|
|
23
23
|
|
|
24
|
-
#
|
|
25
|
-
# platforms is a list of platforms, and each platform has a name and a list of versions.
|
|
26
|
-
#
|
|
27
|
-
# platforms:
|
|
28
|
-
# - name: VYOS
|
|
29
|
-
# versions:
|
|
30
|
-
# - all
|
|
31
|
-
# - 25
|
|
32
|
-
# - name: SomePlatform
|
|
33
|
-
# versions:
|
|
34
|
-
# - all
|
|
35
|
-
# - 1.0
|
|
36
|
-
# - 7
|
|
37
|
-
# - 99.99
|
|
38
|
-
|
|
39
24
|
galaxy_tags: []
|
|
40
25
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
|
41
26
|
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
|
17
17
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
#
|
|
19
|
-
from __future__ import
|
|
19
|
+
from __future__ import annotations
|
|
20
20
|
from ansible.errors import AnsibleError
|
|
21
|
-
__metaclass__ = type
|
|
22
21
|
|
|
23
22
|
### Imports
|
|
24
23
|
try:
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
|
17
17
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
#
|
|
19
|
-
from __future__ import
|
|
19
|
+
from __future__ import annotations
|
|
20
20
|
from ansible.errors import AnsibleError
|
|
21
|
-
__metaclass__ = type
|
|
22
21
|
|
|
23
22
|
try:
|
|
24
23
|
from ansible.plugins.terminal import NetconfBase
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
|
17
17
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
#
|
|
19
|
-
from __future__ import
|
|
19
|
+
from __future__ import annotations
|
|
20
20
|
from ansible.errors import AnsibleError
|
|
21
|
-
__metaclass__ = type
|
|
22
21
|
|
|
23
22
|
try:
|
|
24
23
|
from ansible.plugins.terminal import TerminalBase
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
"""Dependency resolution machinery."""
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
import typing as t
|
|
10
9
|
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
"""Dependency structs."""
|
|
5
5
|
# FIXME: add caching all over the place
|
|
6
6
|
|
|
7
|
-
from __future__ import
|
|
8
|
-
__metaclass__ = type
|
|
7
|
+
from __future__ import annotations
|
|
9
8
|
|
|
10
9
|
import os
|
|
11
10
|
import typing as t
|
|
@@ -463,8 +462,8 @@ class _ComputedReqKindsMixin:
|
|
|
463
462
|
def __unicode__(self):
|
|
464
463
|
if self.fqcn is None:
|
|
465
464
|
return (
|
|
466
|
-
|
|
467
|
-
else
|
|
465
|
+
f'{self.type} collection from a Git repo' if self.is_scm
|
|
466
|
+
else f'{self.type} collection from a namespace'
|
|
468
467
|
)
|
|
469
468
|
|
|
470
469
|
return (
|
|
@@ -504,14 +503,14 @@ class _ComputedReqKindsMixin:
|
|
|
504
503
|
@property
|
|
505
504
|
def namespace(self):
|
|
506
505
|
if self.is_virtual:
|
|
507
|
-
raise TypeError('
|
|
506
|
+
raise TypeError(f'{self.type} collections do not have a namespace')
|
|
508
507
|
|
|
509
508
|
return self._get_separate_ns_n_name()[0]
|
|
510
509
|
|
|
511
510
|
@property
|
|
512
511
|
def name(self):
|
|
513
512
|
if self.is_virtual:
|
|
514
|
-
raise TypeError('
|
|
513
|
+
raise TypeError(f'{self.type} collections do not have a name')
|
|
515
514
|
|
|
516
515
|
return self._get_separate_ns_n_name()[-1]
|
|
517
516
|
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
"""Dependency resolution exceptions."""
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
try:
|
|
10
9
|
from resolvelib.resolvers import ( # pylint: disable=unused-import
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
"""Requirement provider interfaces."""
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
import functools
|
|
10
9
|
import typing as t
|
|
@@ -136,7 +135,7 @@ class CollectionDependencyProviderBase(AbstractProvider):
|
|
|
136
135
|
|
|
137
136
|
:param resolutions: Mapping of identifier, candidate pairs.
|
|
138
137
|
|
|
139
|
-
:param candidates: Possible candidates for the
|
|
138
|
+
:param candidates: Possible candidates for the identifier.
|
|
140
139
|
Mapping of identifier, list of candidate pairs.
|
|
141
140
|
|
|
142
141
|
:param information: Requirement information of each package.
|
|
@@ -443,7 +442,7 @@ class CollectionDependencyProviderBase(AbstractProvider):
|
|
|
443
442
|
|
|
444
443
|
# NOTE: This guard expression MUST perform an early exit only
|
|
445
444
|
# NOTE: after the `get_collection_dependencies()` call because
|
|
446
|
-
# NOTE: internally it
|
|
445
|
+
# NOTE: internally it populates the artifact URL of the candidate,
|
|
447
446
|
# NOTE: its SHA hash and the Galaxy API token. These are still
|
|
448
447
|
# NOTE: necessary with `--no-deps` because even with the disabled
|
|
449
448
|
# NOTE: dependency resolution the outer layer will still need to
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
# Copyright: (c) 2020-2021, Ansible Project
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
|
-
"""
|
|
4
|
+
"""Requirement reporter implementations."""
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
try:
|
|
10
9
|
from resolvelib import BaseReporter
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
"""Requirement resolver implementations."""
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
try:
|
|
10
9
|
from resolvelib import Resolver
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
"""Version comparison helpers."""
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
import operator
|
|
10
9
|
|
ansible/galaxy/role.py
CHANGED
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
#
|
|
20
20
|
########################################################################
|
|
21
21
|
|
|
22
|
-
from __future__ import
|
|
23
|
-
__metaclass__ = type
|
|
22
|
+
from __future__ import annotations
|
|
24
23
|
|
|
25
24
|
import errno
|
|
26
25
|
import datetime
|
|
@@ -298,7 +297,7 @@ class GalaxyRole(object):
|
|
|
298
297
|
# are no versions in the list, we'll grab the head
|
|
299
298
|
# of the master branch
|
|
300
299
|
if len(role_versions) > 0:
|
|
301
|
-
loose_versions = [LooseVersion(a.get('name'
|
|
300
|
+
loose_versions = [v for a in role_versions if (v := LooseVersion()) and v.parse(a.get('name') or '') is None]
|
|
302
301
|
try:
|
|
303
302
|
loose_versions.sort()
|
|
304
303
|
except TypeError:
|
ansible/galaxy/token.py
CHANGED
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
19
19
|
#
|
|
20
20
|
########################################################################
|
|
21
|
-
from __future__ import
|
|
22
|
-
__metaclass__ = type
|
|
21
|
+
from __future__ import annotations
|
|
23
22
|
|
|
24
23
|
import base64
|
|
25
24
|
import os
|
ansible/galaxy/user_agent.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Copyright: (c) 2019, Ansible Project
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
3
|
|
|
4
|
-
from __future__ import
|
|
5
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
6
5
|
|
|
7
6
|
import platform
|
|
8
7
|
import sys
|
ansible/inventory/data.py
CHANGED
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
|
|
18
18
|
#############################################
|
|
19
|
-
from __future__ import
|
|
20
|
-
__metaclass__ = type
|
|
19
|
+
from __future__ import annotations
|
|
21
20
|
|
|
22
21
|
import sys
|
|
23
22
|
|
ansible/inventory/group.py
CHANGED
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
from __future__ import
|
|
18
|
-
__metaclass__ = type
|
|
17
|
+
from __future__ import annotations
|
|
19
18
|
|
|
20
19
|
from collections.abc import Mapping, MutableMapping
|
|
21
20
|
from enum import Enum
|
ansible/inventory/helpers.py
CHANGED
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
|
|
18
18
|
#############################################
|
|
19
|
-
from __future__ import
|
|
20
|
-
__metaclass__ = type
|
|
19
|
+
from __future__ import annotations
|
|
21
20
|
|
|
22
21
|
from ansible.utils.vars import combine_vars
|
|
23
22
|
|
ansible/inventory/host.py
CHANGED
|
@@ -15,9 +15,7 @@
|
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
from __future__ import (absolute_import, division, print_function)
|
|
20
|
-
__metaclass__ = type
|
|
18
|
+
from __future__ import annotations
|
|
21
19
|
|
|
22
20
|
from collections.abc import Mapping, MutableMapping
|
|
23
21
|
|
ansible/inventory/manager.py
CHANGED
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
|
|
18
18
|
#############################################
|
|
19
|
-
from __future__ import
|
|
20
|
-
__metaclass__ = type
|
|
19
|
+
from __future__ import annotations
|
|
21
20
|
|
|
22
21
|
import fnmatch
|
|
23
22
|
import os
|