|
|
@ -22,7 +22,7 @@ def _warning(msg):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
from __main__ import display
|
|
|
|
from __main__ import display
|
|
|
|
display.warning(msg)
|
|
|
|
display.warning(msg)
|
|
|
|
except:
|
|
|
|
except Exception:
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
sys.stderr.write(' [WARNING] %s\n' % (msg))
|
|
|
|
sys.stderr.write(' [WARNING] %s\n' % (msg))
|
|
|
|
|
|
|
|
|
|
|
@ -32,7 +32,7 @@ def _deprecated(msg, version='2.8'):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
from __main__ import display
|
|
|
|
from __main__ import display
|
|
|
|
display.deprecated(msg, version=version)
|
|
|
|
display.deprecated(msg, version=version)
|
|
|
|
except:
|
|
|
|
except Exception:
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
sys.stderr.write(' [DEPRECATED] %s, to be removed in %s\n' % (msg, version))
|
|
|
|
sys.stderr.write(' [DEPRECATED] %s, to be removed in %s\n' % (msg, version))
|
|
|
|
|
|
|
|
|
|
|
@ -53,7 +53,7 @@ def get_config(parser, section, key, env_var, default_value, value_type=None, ex
|
|
|
|
if value is None:
|
|
|
|
if value is None:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
value = get_ini_config_value(parser, {'key': key, 'section': section})
|
|
|
|
value = get_ini_config_value(parser, {'key': key, 'section': section})
|
|
|
|
except:
|
|
|
|
except Exception:
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
if value is None:
|
|
|
|
if value is None:
|
|
|
|
value = default_value
|
|
|
|
value = default_value
|
|
|
@ -121,6 +121,10 @@ VAULT_VERSION_MAX = 1.0
|
|
|
|
# object. The dictionary values are tuples, to account for aliases
|
|
|
|
# object. The dictionary values are tuples, to account for aliases
|
|
|
|
# in variable names.
|
|
|
|
# in variable names.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COMMON_CONNECTION_VARS = frozenset(set(('ansible_connection', 'ansible_host', 'ansible_user', 'ansible_shell_executable',
|
|
|
|
|
|
|
|
'ansible_port', 'ansible_pipelining', 'ansible_password', 'ansible_timeout',
|
|
|
|
|
|
|
|
'ansible_shell_type', 'ansible_module_compression', 'ansible_private_key_file')))
|
|
|
|
|
|
|
|
|
|
|
|
MAGIC_VARIABLE_MAPPING = dict(
|
|
|
|
MAGIC_VARIABLE_MAPPING = dict(
|
|
|
|
|
|
|
|
|
|
|
|
# base
|
|
|
|
# base
|
|
|
@ -191,7 +195,7 @@ for setting in config.data.get_settings():
|
|
|
|
value = literal_eval(value)
|
|
|
|
value = literal_eval(value)
|
|
|
|
except ValueError:
|
|
|
|
except ValueError:
|
|
|
|
pass # not a python data structure
|
|
|
|
pass # not a python data structure
|
|
|
|
except:
|
|
|
|
except Exception:
|
|
|
|
pass # not templatable
|
|
|
|
pass # not templatable
|
|
|
|
value = ensure_type(value, setting.name)
|
|
|
|
value = ensure_type(value, setting.name)
|
|
|
|
|
|
|
|
|
|
|
|