mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 22:51:23 -07:00
remove dupe deprecation on config (#30364)
* remove dupe deprecation on config also move failed typing to same place to use 'standard' display vs hack.
This commit is contained in:
parent
6730f81024
commit
c027ad943e
3 changed files with 6 additions and 10 deletions
|
@ -168,7 +168,7 @@ class CLI(with_metaclass(ABCMeta, object)):
|
||||||
else:
|
else:
|
||||||
display.v(u"No config file found; using defaults")
|
display.v(u"No config file found; using defaults")
|
||||||
|
|
||||||
# warn about deprecated options
|
# warn about deprecated config options
|
||||||
for deprecated in C.config.DEPRECATED:
|
for deprecated in C.config.DEPRECATED:
|
||||||
name = deprecated[0]
|
name = deprecated[0]
|
||||||
why = deprecated[1]['why']
|
why = deprecated[1]['why']
|
||||||
|
@ -179,6 +179,10 @@ class CLI(with_metaclass(ABCMeta, object)):
|
||||||
ver = deprecated[1]['version']
|
ver = deprecated[1]['version']
|
||||||
display.deprecated("%s option, %s %s" % (name, why, alt), version=ver)
|
display.deprecated("%s option, %s %s" % (name, why, alt), version=ver)
|
||||||
|
|
||||||
|
# warn about typing issues with configuration entries
|
||||||
|
for unable in C.config.UNABLE:
|
||||||
|
display.warning("Unable to set correct type for configuration entry: %s" % unable)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def split_vault_id(vault_id):
|
def split_vault_id(vault_id):
|
||||||
# return (before_@, after_@)
|
# return (before_@, after_@)
|
||||||
|
|
|
@ -698,7 +698,7 @@ DEFAULT_HOST_LIST:
|
||||||
deprecated:
|
deprecated:
|
||||||
why: The key is misleading as it can also be a list of hosts, a directory or a list of paths
|
why: The key is misleading as it can also be a list of hosts, a directory or a list of paths
|
||||||
version: "2.8"
|
version: "2.8"
|
||||||
alternatives: inventory
|
alternatives: "[defaults]\ninventory=/path/to/file|dir"
|
||||||
- key: inventory
|
- key: inventory
|
||||||
section: defaults
|
section: defaults
|
||||||
type: pathlist
|
type: pathlist
|
||||||
|
|
|
@ -373,11 +373,3 @@ class ConfigManager(object):
|
||||||
|
|
||||||
# set the constant
|
# set the constant
|
||||||
self.data.update_setting(Setting(config, value, origin, defs[config].get('type', 'string')))
|
self.data.update_setting(Setting(config, value, origin, defs[config].get('type', 'string')))
|
||||||
|
|
||||||
# FIXME: find better way to do this by passing back to where display is available
|
|
||||||
if self.UNABLE:
|
|
||||||
sys.stderr.write("Unable to set correct type for:\n\t%s\n" % '\n\t'.join(self.UNABLE))
|
|
||||||
if self.DEPRECATED:
|
|
||||||
for k, reason in self.DEPRECATED:
|
|
||||||
sys.stderr.write("[DEPRECATED] %(k)s: %(why)s. It will be removed in %(version)s. As alternative use one of [%(alternatives)s]\n"
|
|
||||||
% dict(k=k, **reason))
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue