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


Python cfg.MultiStrOpt方法代码示例

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


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

示例1: register_store_opts

# 需要导入模块: from oslo_config import cfg [as 别名]
# 或者: from oslo_config.cfg import MultiStrOpt [as 别名]
def register_store_opts(conf, reserved_stores=None):
    LOG.debug("Registering options for group %s", _STORE_CFG_GROUP)
    conf.register_opts(_STORE_OPTS, group=_STORE_CFG_GROUP)

    configured_backends = copy.deepcopy(conf.enabled_backends)
    if reserved_stores:
        conf.enabled_backends.update(reserved_stores)
        for key in reserved_stores.keys():
            fs_conf_template = [
                cfg.StrOpt('filesystem_store_datadir',
                           default='/var/lib/glance/{}'.format(key),
                           help=FS_CONF_DATADIR_HELP.format(key)),
                cfg.MultiStrOpt('filesystem_store_datadirs',
                                help="""Not used"""),
                cfg.StrOpt('filesystem_store_metadata_file',
                           help="""Not used"""),
                cfg.IntOpt('filesystem_store_file_perm',
                           default=0,
                           help="""Not used"""),
                cfg.IntOpt('filesystem_store_chunk_size',
                           default=64 * units.Ki,
                           min=1,
                           help=FS_CONF_CHUNKSIZE_HELP.format(key))]
            LOG.debug("Registering options for reserved store: {}".format(key))
            conf.register_opts(fs_conf_template, group=key)

    driver_opts = _list_driver_opts()
    for backend in configured_backends:
        for opt_list in driver_opts:
            if configured_backends[backend] not in opt_list:
                continue

            LOG.debug("Registering options for group %s", backend)
            conf.register_opts(driver_opts[opt_list], group=backend) 
开发者ID:openstack,项目名称:glance_store,代码行数:36,代码来源:multi_backend.py

示例2: _register_cli_opts

# 需要导入模块: from oslo_config import cfg [as 别名]
# 或者: from oslo_config.cfg import MultiStrOpt [as 别名]
def _register_cli_opts():
    cli_opts = [
        cfg.MultiStrOpt('pack', default=None, required=True, positional=True,
                        help='Name of the pack to setup the virtual environment for.'),
        cfg.BoolOpt('update', default=False,
                   help=('Check this option if the virtual environment already exists and if you '
                         'only want to perform an update and installation of new dependencies. If '
                         'you don\'t check this option, the virtual environment will be destroyed '
                         'then re-created. If you check this and the virtual environment doesn\'t '
                         'exist, it will create it..')),
        cfg.BoolOpt('python3', default=False,
                    help='Use Python 3 binary when creating a virtualenv for this pack.'),
    ]
    do_register_cli_opts(cli_opts) 
开发者ID:StackStorm,项目名称:st2,代码行数:16,代码来源:setup_pack_virtualenv.py

示例3: _register_cli_opts

# 需要导入模块: from oslo_config import cfg [as 别名]
# 或者: from oslo_config.cfg import MultiStrOpt [as 别名]
def _register_cli_opts():
    cli_opts = [
        cfg.MultiStrOpt('pack', default=None, required=True, positional=True,
                        help='Name of the pack to install.'),
        cfg.BoolOpt('verify-ssl', default=True,
                   help=('Verify SSL certificate of the Git repo from which the pack is '
                         'downloaded.')),
        cfg.BoolOpt('force', default=False,
                    help='True to force pack installation and ignore install '
                         'lock file if it exists.'),
        cfg.BoolOpt('use-python3', default=False,
                    help='True to use Python3 binary when creating virtualenv '
                         'for this pack.'),
    ]
    do_register_cli_opts(cli_opts) 
开发者ID:StackStorm,项目名称:st2,代码行数:17,代码来源:install_pack.py

示例4: _register_cli_opts

# 需要导入模块: from oslo_config import cfg [as 别名]
# 或者: from oslo_config.cfg import MultiStrOpt [as 别名]
def _register_cli_opts():
    cli_opts = [
        cfg.MultiStrOpt('pack', default=None, required=True, positional=True,
                        help='Name of the pack to install (download).'),
        cfg.BoolOpt('verify-ssl', default=True,
                   help=('Verify SSL certificate of the Git repo from which the pack is '
                         'installed.')),
        cfg.BoolOpt('force', default=False,
                    help='True to force pack download and ignore download '
                         'lock file if it exists.'),
        cfg.BoolOpt('use-python3', default=False,
                    help='True to use Python3 binary.')
    ]
    do_register_cli_opts(cli_opts) 
开发者ID:StackStorm,项目名称:st2,代码行数:16,代码来源:download_pack.py

示例5: list_cli_opts

# 需要导入模块: from oslo_config import cfg [as 别名]
# 或者: from oslo_config.cfg import MultiStrOpt [as 别名]
def list_cli_opts():
    return [
        cfg.SubCommandOpt(name="sub_command",
                          handler=sub_commands,
                          help=_("Available commands"),
                          title="syntribos Commands"),
        cfg.MultiStrOpt("test-types", dest="test_types", short="t",
                        default=[""], sample_default=["SQL", "XSS"],
                        help=_(
                            "Test types to run against the target API")),
        cfg.MultiStrOpt("excluded-types", dest="excluded_types", short="e",
                        default=[""], sample_default=["SQL", "XSS"],
                        help=_("Test types to be excluded from "
                               "current run against the target API")),
        cfg.BoolOpt("colorize", dest="colorize", short="cl",
                    default=True,
                    help=_("Enable color in syntribos terminal output")),
        cfg.StrOpt("outfile", short="o",
                   sample_default="out.json", help=_("File to print "
                                                     "output to")),
        cfg.StrOpt("format", dest="output_format", short="f", default="json",
                   choices=["json"], ignore_case=True,
                   help=_("The format for outputting results")),
        cfg.StrOpt("min-severity", dest="min_severity", short="S",
                   default="LOW", choices=syntribos.RANKING,
                   help=_("Select a minimum severity for reported "
                          "defects")),
        cfg.StrOpt("min-confidence", dest="min_confidence", short="C",
                   default="LOW", choices=syntribos.RANKING,
                   help=_("Select a minimum confidence for reported "
                          "defects")),
        cfg.BoolOpt("stacktrace", dest="stacktrace", default=True,
                    help=_("Select if Syntribos outputs a stacktrace "
                           " if an exception is raised")),
        cfg.StrOpt(
            "custom_root", dest="custom_root",
            help=_("Filesystem location for syntribos root directory, "
                   "containing logs, templates, payloads, config files. "
                   "Creates directories and skips interactive prompts when "
                   "used with 'syntribos init'"),
            deprecated_group="init", deprecated_name="custom_install_root")
    ] 
开发者ID:openstack-archive,项目名称:syntribos,代码行数:44,代码来源:config.py

示例6: list_syntribos_opts

# 需要导入模块: from oslo_config import cfg [as 别名]
# 或者: from oslo_config.cfg import MultiStrOpt [as 别名]
def list_syntribos_opts():
    def wrap_try_except(func):
        def wrap(*args):
            try:
                func(*args)
            except IOError:
                msg = _(
                    "\nCan't open a file or directory specified in the "
                    "config file under the section `[syntribos]`; verify "
                    "if the path exists.\nFor more information please refer "
                    "the debug logs.")
                print(msg)
                exit(1)
        return wrap
    return [
        cfg.StrOpt("endpoint", default="",
                   sample_default="http://localhost/app",
                   help=_("The target host to be tested")),
        cfg.IntOpt("threads", default=16,
                   sample_default="16",
                   help=_("Maximum number of threads syntribos spawns "
                          "(experimental)")),
        cfg.Opt("templates", type=ContentType("r"),
                default="",
                sample_default="~/.syntribos/templates",
                help=_("A directory of template files, or a single "
                       "template file, to test on the target API")),
        cfg.StrOpt("payloads", default="",
                   sample_default="~/.syntribos/data",
                   help=_(
                       "The location where we can find syntribos'"
                       "payloads")),
        cfg.MultiStrOpt("exclude_results",
                        default=[""],
                        sample_default=["500_errors", "length_diff"],
                        help=_(
                            "Defect types to exclude from the "
                            "results output")),
        cfg.Opt("custom_root", type=wrap_try_except(ExistingDirType()),
                short="c",
                sample_default="/your/custom/root",
                help=_(
                    "The root directory where the subfolders that make up"
                    " syntribos' environment (logs, templates, payloads, "
                    "configuration files, etc.)"),
                deprecated_for_removal=True),
        cfg.StrOpt("meta_vars", sample_default="/path/to/meta.json",
                   help=_(
                       "The path to a meta variable definitions file, which "
                       "will be used when parsing your templates")),
    ] 
开发者ID:openstack-archive,项目名称:syntribos,代码行数:53,代码来源:config.py


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