remove dupe deprecation on config (#30364)

* remove dupe deprecation on config

also move failed typing to same place to use 'standard' display vs hack.
pull/30390/head
Brian Coca 7 years ago committed by GitHub
parent 6730f81024
commit c027ad943e

@ -168,7 +168,7 @@ class CLI(with_metaclass(ABCMeta, object)):
else:
display.v(u"No config file found; using defaults")
# warn about deprecated options
# warn about deprecated config options
for deprecated in C.config.DEPRECATED:
name = deprecated[0]
why = deprecated[1]['why']
@ -179,6 +179,10 @@ class CLI(with_metaclass(ABCMeta, object)):
ver = deprecated[1]['version']
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
def split_vault_id(vault_id):
# return (before_@, after_@)

@ -698,7 +698,7 @@ DEFAULT_HOST_LIST:
deprecated:
why: The key is misleading as it can also be a list of hosts, a directory or a list of paths
version: "2.8"
alternatives: inventory
alternatives: "[defaults]\ninventory=/path/to/file|dir"
- key: inventory
section: defaults
type: pathlist

@ -373,11 +373,3 @@ class ConfigManager(object):
# set the constant
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…
Cancel
Save