• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python plugin.configure函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.distance函数代码示例发布时间:2022-05-26
下一篇:
Python discover.itersubclasses函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap