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


Python plugin.configure函数代码示例

本文整理汇总了Python中rally.common.plugin.plugin.configure函数的典型用法代码示例。如果您正苦于以下问题:Python configure函数的具体用法?Python configure怎么用?Python configure使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: test_get_multple_found

    def test_get_multple_found(self):

        @plugin.configure("test_2_plugins_with_same_name")
        class A(plugin.Plugin):
            pass

        class B(plugin.Plugin):
            pass

        self.assertRaises(exceptions.PluginWithSuchNameExists,
                          plugin.configure("test_2_plugins_with_same_name"), B)
开发者ID:NaliniKrishna,项目名称:Rally,代码行数:11,代码来源:test_plugin.py

示例2: test_get_multiple_found_hidden

    def test_get_multiple_found_hidden(self):

        @plugin.configure("test_2_plugins_with_same_name", hidden=True)
        class A(plugin.Plugin):
            pass

        class B(plugin.Plugin):
            pass

        self.assertRaises(exceptions.PluginWithSuchNameExists,
                          plugin.configure("test_2_plugins_with_same_name"), B)

        A.unregister()
开发者ID:andreykurilin,项目名称:rally,代码行数:13,代码来源:test_plugin.py

示例3: wrapper

    def wrapper(cls):
        # TODO(boris-42): Drop this check as soon as we refactor rally report
        if "." not in name.strip("."):
            raise exceptions.RallyException(
                "Scenario name must include a dot: '%s'" % name)

        for c in context:
            if "@" not in c:
                msg = ("Old fashion plugin configuration detected in "
                       " `%(scenario)s' scenario. Use full name for "
                       " `%(context)s' context like %(context)[email protected] "
                       "where 'platform' is a name of context platform ("
                       "openstack, k8s, etc).")
                LOG.warning(msg % {"scenario": "%[email protected]%s" % (name, platform),
                                   "context": c})

        cls = plugin.configure(name=name, platform=platform)(cls)
        cls._meta_setdefault("default_context", {})

        cls._meta_get("default_context").update(context)
        return cls
开发者ID:openstack,项目名称:rally,代码行数:21,代码来源:scenario.py

示例4: wrapper

 def wrapper(cls):
     cls = plugin.configure(name=name, platform="openstack")(cls)
     cls._meta_set("default_version", default_version)
     cls._meta_set("default_service_type", default_service_type)
     cls._meta_set("supported_versions", supported_versions or [])
     return cls
开发者ID:andreykurilin,项目名称:rally,代码行数:6,代码来源:osclients.py

示例5: decorator

 def decorator(plugin_inst):
     plugin_inst = plugin.configure(name, platform=platform)(plugin_inst)
     plugin_inst._meta_set("default_repo", default_repo)
     plugin_inst._meta_set("default_version", default_version)
     plugin_inst._meta_set("context", context or {})
     return plugin_inst
开发者ID:jacobwagner,项目名称:rally,代码行数:6,代码来源:manager.py

示例6: wrapper

 def wrapper(cls):
     cls = plugin.configure(name=name, namespace=_NAMESPACE)(cls)
     cls._meta_set("default_version", default_version)
     cls._meta_set("default_service_type", default_service_type)
     cls._meta_set("supported_versions", supported_versions or [])
     return cls
开发者ID:amit0701,项目名称:rally,代码行数:6,代码来源:osclients.py

示例7: configure

def configure(name, namespace="default"):
    return plugin.configure(name, namespace=namespace)
开发者ID:plomakin,项目名称:rally,代码行数:2,代码来源:engine.py

示例8: wrapper

 def wrapper(cls):
     cls = plugin.configure(name="credential_builder",
                            platform=platform)(cls)
     return cls
开发者ID:andreykurilin,项目名称:rally,代码行数:4,代码来源:credential.py

示例9: wrapper

 def wrapper(cls):
     cls = plugin.configure(name=name, platform=platform,
                            hidden=hidden)(cls)
     cls._meta_set("order", order)
     return cls
开发者ID:andreykurilin,项目名称:rally,代码行数:5,代码来源:context.py

示例10: wrapper

 def wrapper(cls):
     cls = plugin.configure(name=name)(cls)
     cls._meta_set("order", order)
     cls._meta_set("hidden", hidden)
     return cls
开发者ID:sckevmit,项目名称:rally,代码行数:5,代码来源:context.py

示例11: wrapper

 def wrapper(cls):
     return plugin.configure(name=name, platform=platform)(cls)
开发者ID:jacobwagner,项目名称:rally,代码行数:2,代码来源:platform.py

示例12: configure

def configure(name):
    return plugin.configure(name, namespace=_NAMESPACE)
开发者ID:openvswitch,项目名称:ovn-scale-test,代码行数:2,代码来源:ovsclients.py


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