|
|
@ -17,6 +17,16 @@ from ansible.module_utils.six import string_types
|
|
|
|
from ansible.config.manager import ConfigManager, ensure_type, get_ini_config_value
|
|
|
|
from ansible.config.manager import ConfigManager, ensure_type, get_ini_config_value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _warning(msg):
|
|
|
|
|
|
|
|
''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write '''
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
from __main__ import display
|
|
|
|
|
|
|
|
display.warning(msg)
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
sys.stderr.write(' [WARNING] %s\n' % (msg))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _deprecated(msg, version='2.8'):
|
|
|
|
def _deprecated(msg, version='2.8'):
|
|
|
|
''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write '''
|
|
|
|
''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write '''
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -24,7 +34,7 @@ def _deprecated(msg, version='2.8'):
|
|
|
|
display.deprecated(msg, version=version)
|
|
|
|
display.deprecated(msg, version=version)
|
|
|
|
except:
|
|
|
|
except:
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
sys.stderr.write('[DEPRECATED] %s, to be removed in %s' % (msg, version))
|
|
|
|
sys.stderr.write(' [DEPRECATED] %s, to be removed in %s\n' % (msg, version))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def mk_boolean(value):
|
|
|
|
def mk_boolean(value):
|
|
|
@ -189,3 +199,6 @@ for setting in config.data.get_settings():
|
|
|
|
value = ensure_type(value, setting.type)
|
|
|
|
value = ensure_type(value, setting.type)
|
|
|
|
|
|
|
|
|
|
|
|
set_constant(setting.name, value)
|
|
|
|
set_constant(setting.name, value)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for warn in config.WARNINGS:
|
|
|
|
|
|
|
|
_warning(warn)
|
|
|
|