本文整理匯總了Python中ooinstall.oo_config.OOConfig.settings["ansible_log_path"]方法的典型用法代碼示例。如果您正苦於以下問題:Python OOConfig.settings["ansible_log_path"]方法的具體用法?Python OOConfig.settings["ansible_log_path"]怎麽用?Python OOConfig.settings["ansible_log_path"]使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ooinstall.oo_config.OOConfig
的用法示例。
在下文中一共展示了OOConfig.settings["ansible_log_path"]方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: cli
# 需要導入模塊: from ooinstall.oo_config import OOConfig [as 別名]
# 或者: from ooinstall.oo_config.OOConfig import settings["ansible_log_path"] [as 別名]
def cli(ctx, unattended, configuration, ansible_playbook_directory, ansible_config, ansible_log_path, verbose, debug):
"""
atomic-openshift-installer makes the process for installing OSE or AEP
easier by interactively gathering the data needed to run on each host.
It can also be run in unattended mode if provided with a configuration file.
Further reading: https://docs.openshift.com/enterprise/latest/install_config/install/quick_install.html
"""
if debug:
# DEFAULT log level threshold is set to CRITICAL (the
# highest), anything below that (we only use debug/warning
# presently) is not logged. If '-d' is given though, we'll
# lower the threshold to debug (almost everything gets through)
installer_log.setLevel(logging.DEBUG)
installer_log.debug("Quick Installer debugging initialized")
ctx.obj = {}
ctx.obj["unattended"] = unattended
ctx.obj["configuration"] = configuration
ctx.obj["ansible_config"] = ansible_config
ctx.obj["ansible_log_path"] = ansible_log_path
ctx.obj["verbose"] = verbose
try:
oo_cfg = OOConfig(ctx.obj["configuration"])
except OOConfigInvalidHostError as e:
click.echo(e)
sys.exit(1)
# If no playbook dir on the CLI, check the config:
if not ansible_playbook_directory:
ansible_playbook_directory = oo_cfg.settings.get("ansible_playbook_directory", "")
# If still no playbook dir, check for the default location:
if not ansible_playbook_directory and os.path.exists(DEFAULT_PLAYBOOK_DIR):
ansible_playbook_directory = DEFAULT_PLAYBOOK_DIR
validate_ansible_dir(ansible_playbook_directory)
oo_cfg.settings["ansible_playbook_directory"] = ansible_playbook_directory
oo_cfg.ansible_playbook_directory = ansible_playbook_directory
ctx.obj["ansible_playbook_directory"] = ansible_playbook_directory
if ctx.obj["ansible_config"]:
oo_cfg.settings["ansible_config"] = ctx.obj["ansible_config"]
elif "ansible_config" not in oo_cfg.settings and os.path.exists(DEFAULT_ANSIBLE_CONFIG):
# If we're installed by RPM this file should exist and we can use it as our default:
oo_cfg.settings["ansible_config"] = DEFAULT_ANSIBLE_CONFIG
oo_cfg.settings["ansible_log_path"] = ctx.obj["ansible_log_path"]
ctx.obj["oo_cfg"] = oo_cfg
openshift_ansible.set_config(oo_cfg)