当前位置: 首页>>代码示例>>Python>>正文


Python OOConfig.settings['ansible_quiet_config']方法代码示例

本文整理汇总了Python中ooinstall.oo_config.OOConfig.settings['ansible_quiet_config']方法的典型用法代码示例。如果您正苦于以下问题:Python OOConfig.settings['ansible_quiet_config']方法的具体用法?Python OOConfig.settings['ansible_quiet_config']怎么用?Python OOConfig.settings['ansible_quiet_config']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ooinstall.oo_config.OOConfig的用法示例。


在下文中一共展示了OOConfig.settings['ansible_quiet_config']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: cli

# 需要导入模块: from ooinstall.oo_config import OOConfig [as 别名]
# 或者: from ooinstall.oo_config.OOConfig import settings['ansible_quiet_config'] [as 别名]
def cli(ctx, unattended, configuration, ansible_playbook_directory, 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_log_path'] = ansible_log_path
    ctx.obj['verbose'] = verbose

    try:
        oo_cfg = OOConfig(ctx.obj['configuration'])
    except OOConfigInvalidHostError as err:
        click.echo(err)
        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 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

    if not verbose and os.path.exists(QUIET_ANSIBLE_CONFIG):
        oo_cfg.settings['ansible_quiet_config'] = QUIET_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)
开发者ID:dabelenda,项目名称:openshift-ansible,代码行数:52,代码来源:cli_installer.py


注:本文中的ooinstall.oo_config.OOConfig.settings['ansible_quiet_config']方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。