mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Remove deprecated tags config option (#44479)
* Remove deprecated tags config option * wordsmith porting guide entry acozine via github
This commit is contained in:
parent
18f361ecdd
commit
0e7b470a01
4 changed files with 22 additions and 26 deletions
8
changelogs/fragments/remove-merge-multiple-tags.yaml
Normal file
8
changelogs/fragments/remove-merge-multiple-tags.yaml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
removed_features:
|
||||||
|
- The configuration toggle, ``merge_multiple_cli_tags``, has been removed.
|
||||||
|
This setting controlled whether specifying ``--tags`` or ``--skip-tags``
|
||||||
|
multiple times on the commandline would merge the specified tags or use the
|
||||||
|
old behaviour of overwriting the previous entry. The overwriting behaviour
|
||||||
|
was deprecated in 2.3 and the default value of the config option became merge
|
||||||
|
in 2.4.
|
|
@ -14,6 +14,20 @@ This document is part of a collection on porting. The complete list of porting g
|
||||||
|
|
||||||
.. contents:: Topics
|
.. contents:: Topics
|
||||||
|
|
||||||
|
Command Line
|
||||||
|
============
|
||||||
|
|
||||||
|
If you specify ``--tags`` or ``--skip-tags`` multiple times on the command line, Ansible will merge the specified
|
||||||
|
tags together. In previous versions of Ansible, you could set ``merge_multiple_cli_tags`` to ``False``
|
||||||
|
if you wanted to keep only the last-specified ``--tags``. This config
|
||||||
|
option existed for backwards compatibility. The overwriting behavior was deprecated in 2.3 and
|
||||||
|
the default behavior was changed in 2.4. Ansible-2.7 removes the config option; multiple
|
||||||
|
``--tags`` are now always merged.
|
||||||
|
|
||||||
|
If you have a shell script that depends on setting ``merge_multiple_cli_tags`` to ``False``, please upgrade your script
|
||||||
|
so it only adds the ``--tags`` you actually want before upgrading to Ansible-2.7.
|
||||||
|
|
||||||
|
|
||||||
Python Compatibility
|
Python Compatibility
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
|
|
@ -583,13 +583,6 @@ class CLI(with_metaclass(ABCMeta, object)):
|
||||||
# optparse defaults does not do what's expected
|
# optparse defaults does not do what's expected
|
||||||
self.options.tags = ['all']
|
self.options.tags = ['all']
|
||||||
if hasattr(self.options, 'tags') and self.options.tags:
|
if hasattr(self.options, 'tags') and self.options.tags:
|
||||||
if not C.MERGE_MULTIPLE_CLI_TAGS:
|
|
||||||
if len(self.options.tags) > 1:
|
|
||||||
display.deprecated('Specifying --tags multiple times on the command line currently uses the last specified value. '
|
|
||||||
'In 2.4, values will be merged instead. Set merge_multiple_cli_tags=True in ansible.cfg to get this behavior now.',
|
|
||||||
version=2.5, removed=False)
|
|
||||||
self.options.tags = [self.options.tags[-1]]
|
|
||||||
|
|
||||||
tags = set()
|
tags = set()
|
||||||
for tag_set in self.options.tags:
|
for tag_set in self.options.tags:
|
||||||
for tag in tag_set.split(u','):
|
for tag in tag_set.split(u','):
|
||||||
|
@ -598,13 +591,6 @@ class CLI(with_metaclass(ABCMeta, object)):
|
||||||
|
|
||||||
# process skip_tags
|
# process skip_tags
|
||||||
if hasattr(self.options, 'skip_tags') and self.options.skip_tags:
|
if hasattr(self.options, 'skip_tags') and self.options.skip_tags:
|
||||||
if not C.MERGE_MULTIPLE_CLI_TAGS:
|
|
||||||
if len(self.options.skip_tags) > 1:
|
|
||||||
display.deprecated('Specifying --skip-tags multiple times on the command line currently uses the last specified value. '
|
|
||||||
'In 2.4, values will be merged instead. Set merge_multiple_cli_tags=True in ansible.cfg to get this behavior now.',
|
|
||||||
version=2.5, removed=False)
|
|
||||||
self.options.skip_tags = [self.options.skip_tags[-1]]
|
|
||||||
|
|
||||||
skip_tags = set()
|
skip_tags = set()
|
||||||
for tag_set in self.options.skip_tags:
|
for tag_set in self.options.skip_tags:
|
||||||
for tag in tag_set.split(u','):
|
for tag in tag_set.split(u','):
|
||||||
|
|
|
@ -1459,18 +1459,6 @@ MAX_FILE_SIZE_FOR_DIFF:
|
||||||
ini:
|
ini:
|
||||||
- {key: max_diff_size, section: defaults}
|
- {key: max_diff_size, section: defaults}
|
||||||
type: int
|
type: int
|
||||||
MERGE_MULTIPLE_CLI_TAGS:
|
|
||||||
name: Merge 'tags' options
|
|
||||||
default: True
|
|
||||||
description:
|
|
||||||
- "This allows changing how multiple --tags and --skip-tags arguments are handled on the command line.
|
|
||||||
In Ansible up to and including 2.3, specifying --tags more than once will only take the last value of --tags."
|
|
||||||
- "Setting this config value to True will mean that all of the --tags options will be merged together. The same holds true for --skip-tags."
|
|
||||||
env: [{name: ANSIBLE_MERGE_MULTIPLE_CLI_TAGS}]
|
|
||||||
ini:
|
|
||||||
- {key: merge_multiple_cli_tags, section: defaults}
|
|
||||||
type: bool
|
|
||||||
version_added: "2.3"
|
|
||||||
NETWORK_GROUP_MODULES:
|
NETWORK_GROUP_MODULES:
|
||||||
name: Network module families
|
name: Network module families
|
||||||
default: [eos, nxos, ios, iosxr, junos, enos, ce, vyos, sros, dellos9, dellos10, dellos6, asa, aruba, aireos, bigip, ironware, onyx, netconf]
|
default: [eos, nxos, ios, iosxr, junos, enos, ce, vyos, sros, dellos9, dellos10, dellos6, asa, aruba, aireos, bigip, ironware, onyx, netconf]
|
||||||
|
|
Loading…
Reference in a new issue