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

Python api.get_ofc_id_lookup_both函数代码示例

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

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



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

示例1: test_convert_network_id

    def test_convert_network_id(self):
        t_id, ofc_t_id, ofc_n_id = self.generate_random_ids(3)
        ndb.get_ofc_id_lookup_both(self.ctx.session, "ofc_tenant", t_id).AndReturn(ofc_t_id)
        self.mox.ReplayAll()

        ret = self.driver.convert_ofc_network_id(self.ctx, ofc_n_id, t_id)
        self.assertEqual(ret, ("/tenants/%(tenant)s/networks/%(network)s" % {"tenant": ofc_t_id, "network": ofc_n_id}))
        self.mox.VerifyAll()
开发者ID:vglafirov,项目名称:quantum,代码行数:8,代码来源:test_pfc_driver.py


示例2: _test_convert_port_id

    def _test_convert_port_id(self, port_path_template):
        t_id, n_id = generate_random_ids(2)
        ofc_n_id, ofc_p_id = generate_random_ids(2)

        ndb.get_ofc_id_lookup_both(self.ctx.session, "ofc_network", n_id).AndReturn(ofc_n_id)
        self.mox.ReplayAll()

        ret = self.driver.convert_ofc_port_id(self.ctx, ofc_p_id, t_id, n_id)
        exp = port_path_template % {"network": ofc_n_id, "port": ofc_p_id}
        self.assertEqual(ret, exp)
        self.mox.VerifyAll()
开发者ID:rosstaylor,项目名称:quantum,代码行数:11,代码来源:test_trema_driver.py


示例3: test_convert_network_id_with_new_tenant_id

    def test_convert_network_id_with_new_tenant_id(self):
        t_id, ofc_t_id, ofc_n_id = self.generate_random_ids(3)
        ofc_t_path = '/tenants/%s' % ofc_t_id
        ndb.get_ofc_id_lookup_both(
            self.ctx.session, 'ofc_tenant', t_id).AndReturn(ofc_t_path)
        self.mox.ReplayAll()

        ret = self.driver.convert_ofc_network_id(self.ctx, ofc_n_id, t_id)
        self.assertEqual(ret, ('/tenants/%(tenant)s/networks/%(network)s' %
                               {'tenant': ofc_t_id, 'network': ofc_n_id}))
        self.mox.VerifyAll()
开发者ID:Apsu,项目名称:quantum,代码行数:11,代码来源:test_pfc_driver.py


示例4: test_convert_port_id

    def test_convert_port_id(self):
        t_id, n_id = self.generate_random_ids(2)
        ofc_t_id, ofc_n_id, ofc_p_id = self.generate_random_ids(3)

        ndb.get_ofc_id_lookup_both(
            self.ctx.session, 'ofc_network', n_id).AndReturn(ofc_n_id)
        ndb.get_ofc_id_lookup_both(
            self.ctx.session, 'ofc_tenant', t_id).AndReturn(ofc_t_id)
        self.mox.ReplayAll()

        ret = self.driver.convert_ofc_port_id(self.ctx, ofc_p_id, t_id, n_id)
        exp = ('/tenants/%(tenant)s/networks/%(network)s/ports/%(port)s' %
               {'tenant': ofc_t_id, 'network': ofc_n_id, 'port': ofc_p_id})
        self.assertEqual(ret, exp)
        self.mox.VerifyAll()
开发者ID:Apsu,项目名称:quantum,代码行数:15,代码来源:test_pfc_driver.py


示例5: _test_convert_port_id_with_new_network_id

    def _test_convert_port_id_with_new_network_id(self, port_path_template):
        t_id, n_id = generate_random_ids(2)
        ofc_n_id, ofc_p_id = generate_random_ids(2)

        ofc_n_path = '/networks/%s' % ofc_n_id
        ndb.get_ofc_id_lookup_both(
            self.ctx.session, 'ofc_network', n_id).AndReturn(ofc_n_path)
        self.mox.ReplayAll()

        ret = self.driver.convert_ofc_port_id(self.ctx, ofc_p_id, t_id, n_id)
        exp = port_path_template % {'network': ofc_n_id, 'port': ofc_p_id}
        print 'exp=', exp
        print 'ret=', ret
        self.assertEqual(ret, exp)
        self.mox.VerifyAll()
开发者ID:Frostman,项目名称:quantum,代码行数:15,代码来源:test_trema_driver.py


示例6: test_convert_port_id_with_new_network_id

    def test_convert_port_id_with_new_network_id(self):
        t_id, n_id = self.generate_random_ids(2)
        ofc_t_id, ofc_n_id, ofc_p_id = self.generate_random_ids(3)

        ofc_n_path = "/tenants/%(tenant)s/networks/%(network)s" % {"tenant": ofc_t_id, "network": ofc_n_id}
        ndb.get_ofc_id_lookup_both(self.ctx.session, "ofc_network", n_id).AndReturn(ofc_n_path)
        self.mox.ReplayAll()

        ret = self.driver.convert_ofc_port_id(self.ctx, ofc_p_id, t_id, n_id)
        exp = "/tenants/%(tenant)s/networks/%(network)s/ports/%(port)s" % {
            "tenant": ofc_t_id,
            "network": ofc_n_id,
            "port": ofc_p_id,
        }
        self.assertEqual(ret, exp)
        self.mox.VerifyAll()
开发者ID:vglafirov,项目名称:quantum,代码行数:16,代码来源:test_pfc_driver.py


示例7: convert_ofc_network_id

    def convert_ofc_network_id(self, context, ofc_network_id, tenant_id):
        # If ofc_network_id starts with '/', it is already new-style
        if ofc_network_id[0] == '/':
            return ofc_network_id

        ofc_tenant_id = ndb.get_ofc_id_lookup_both(
            context.session, 'ofc_tenant', tenant_id)
        ofc_tenant_id = self.convert_ofc_tenant_id(context, ofc_tenant_id)
        params = dict(tenant=ofc_tenant_id, network=ofc_network_id)
        return '%(tenant)s/networks/%(network)s' % params
开发者ID:CiscoAS,项目名称:quantum,代码行数:10,代码来源:pfc.py


示例8: convert_ofc_port_id

    def convert_ofc_port_id(self, context, ofc_port_id, tenant_id, network_id):
        # If ofc_port_id  starts with '/', it is already new-style
        if ofc_port_id[0] == '/':
            return ofc_port_id

        ofc_network_id = ndb.get_ofc_id_lookup_both(
            context.session, 'ofc_network', network_id)
        ofc_network_id = self.convert_ofc_network_id(
            context, ofc_network_id, tenant_id)
        return self.attachment_path % {'network': ofc_network_id,
                                       'attachment': ofc_port_id}
开发者ID:AmirolAhmad,项目名称:quantum,代码行数:11,代码来源:trema.py


示例9: test_get_ofc_id_old

 def test_get_ofc_id_old(self):
     o, q, n = self.get_ofc_item_random_params()
     ndb.add_ofc_item(self.session, 'ofc_tenant', q, o, self.OLD)
     self._check_new_old_item(ndb.get_ofc_id, q, None, o)
     ret = ndb.get_ofc_id_lookup_both(self.session, 'ofc_tenant', q)
     self.assertEqual(ret, o)
开发者ID:AmirolAhmad,项目名称:quantum,代码行数:6,代码来源:test_db.py


示例10: _get_ofc_id

 def _get_ofc_id(self, context, resource, quantum_id):
     return ndb.get_ofc_id_lookup_both(context.session,
                                       resource, quantum_id)
开发者ID:Apsu,项目名称:quantum,代码行数:3,代码来源:ofc_manager.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python api.get_ofc_item函数代码示例发布时间:2022-05-26
下一篇:
Python api.add_portinfo函数代码示例发布时间: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