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

Python utils.try_del函数代码示例

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

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



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

示例1: filter_create_attributes

 def filter_create_attributes(cls, port):
     """Filter out port attributes not required for a create."""
     # TODO(kmestery): Converting to uppercase due to ODL bug
     # https://bugs.opendaylight.org/show_bug.cgi?id=477
     port['mac_address'] = port['mac_address'].upper()
     cls._filter_unmapped_null(port)
     odl_utils.try_del(port, ['status'])
开发者ID:takahashinobuyuki,项目名称:test2,代码行数:7,代码来源:filters.py


示例2: filter_create_port_attributes

 def filter_create_port_attributes(cls, port, context):
     """Filter out port attributes not required for a create."""
     cls.add_security_groups(port, context)
     # TODO(kmestery): Converting to uppercase due to ODL bug
     # https://bugs.opendaylight.org/show_bug.cgi?id=477
     port['mac_address'] = port['mac_address'].upper()
     odl_utils.try_del(port, ['status'])
开发者ID:CingHu,项目名称:networking-odl,代码行数:7,代码来源:mech_driver.py


示例3: filter_update_attributes

 def filter_update_attributes(cls, port, context):
     """Filter out port attributes for an update operation."""
     cls._add_security_groups(port, context)
     cls._fixup_mac_address(port)
     cls._fixup_allowed_ipaddress_pairs(port[addr_pair.ADDRESS_PAIRS])
     odl_utils.try_del(port, ['network_id', 'id', 'status', 'mac_address',
                       'tenant_id', 'fixed_ips'])
开发者ID:hashyuan,项目名称:networking-odl,代码行数:7,代码来源:mech_driver.py


示例4: filter_create_attributes

    def filter_create_attributes(cls, port, context):
        """Filter out port attributes not required for a create."""
        cls._add_security_groups(port, context)
        cls._fixup_mac_address(port)
        cls._fixup_allowed_ipaddress_pairs(port[addr_pair.ADDRESS_PAIRS])
        odl_utils.try_del(port, ['status'])

        # NOTE(yamahata): work around for port creation for router
        # tenant_id=''(empty string) is passed when port is created
        # by l3 plugin internally for router.
        # On the other hand, ODL doesn't accept empty string for tenant_id.
        # In that case, deduce tenant_id from network_id for now.
        # Right fix: modify Neutron so that don't allow empty string
        # for tenant_id even for port for internal use.
        # TODO(yamahata): eliminate this work around when neutron side
        # is fixed
        # assert port['tenant_id'] != ''
        if port['tenant_id'] == '':
            LOG.debug('empty string was passed for tenant_id: %s(port)', port)
            port['tenant_id'] = context._network_context._network['tenant_id']
开发者ID:hashyuan,项目名称:networking-odl,代码行数:20,代码来源:mech_driver.py


示例5: filter_create_port_attributes

    def filter_create_port_attributes(cls, port, context):
        """Filter out port attributes not required for a create."""
        cls.add_security_groups(port, context)
        # TODO(kmestery): Converting to uppercase due to ODL bug
        # https://bugs.opendaylight.org/show_bug.cgi?id=477
        port['mac_address'] = port['mac_address'].upper()
        odl_utils.try_del(port, ['status'])

        # NOTE(yamahata): work around for port creation for router
        # tenant_id=''(empty string) is passed when port is created
        # by l3 plugin internally for router.
        # On the other hand, ODL doesn't accept empty string for tenant_id.
        # In that case, deduce tenant_id from network_id for now.
        # Right fix: modify Neutron so that don't allow empty string
        # for tenant_id even for port for internal use.
        # TODO(yamahata): eliminate this work around when neutron side
        # is fixed
        # assert port['tenant_id'] != ''
        if port['tenant_id'] == '':
            LOG.debug('empty string was passed for tenant_id: %s(port)', port)
            port['tenant_id'] = context._network_context._network['tenant_id']
开发者ID:trozet,项目名称:networking-odl,代码行数:21,代码来源:mech_driver.py


示例6: _filter_unmapped_null

def _filter_unmapped_null(resource_dict, unmapped_keys):
    # NOTE(yamahata): bug work around
    # https://bugs.eclipse.org/bugs/show_bug.cgi?id=475475
    #   Null-value for an unmapped element causes next mapped
    #   collection to contain a null value
    #   JSON: { "unmappedField": null, "mappedCollection": [ "a" ] }
    #
    #   Java Object:
    #   class Root {
    #     Collection<String> mappedCollection = new ArrayList<String>;
    #   }
    #
    #   Result:
    #   Field B contains one element; null
    #
    # TODO(yamahata): update along side with neutron and ODL
    #   add when neutron adds more extensions
    #   delete when ODL neutron northbound supports it
    # TODO(yamahata): do same thing for other resources
    keys_to_del = [key for key in unmapped_keys
                   if resource_dict.get(key) is None]
    if keys_to_del:
        odl_utils.try_del(resource_dict, keys_to_del)
开发者ID:vpramo,项目名称:networking-odl,代码行数:23,代码来源:filters.py


示例7: filter_update_port_attributes

 def filter_update_port_attributes(cls, port, context):
     """Filter out port attributes for an update operation."""
     cls.add_security_groups(port, context)
     odl_utils.try_del(port, ['network_id', 'id', 'status', 'mac_address',
                       'tenant_id', 'fixed_ips'])
开发者ID:trozet,项目名称:networking-odl,代码行数:5,代码来源:mech_driver.py


示例8: _filter_port_update

def _filter_port_update(port):
    """Filter out port attributes for an update operation."""
    odl_utils.try_del(port, ['network_id', 'id', 'status', 'mac_address',
                      'tenant_id', 'fixed_ips'])
    _filter_unmapped_null(port, _PORT_UNMAPPED_KEYS)
开发者ID:vpramo,项目名称:networking-odl,代码行数:5,代码来源:filters.py


示例9: _filter_network_update

def _filter_network_update(network):
    odl_utils.try_del(network, ['id', 'status', 'subnets', 'tenant_id'])
开发者ID:heekof,项目名称:networking-odl,代码行数:2,代码来源:filters.py


示例10: filter_create_attributes

 def filter_create_attributes(cls, port):
     """Filter out port attributes not required for a create."""
     cls._filter_unmapped_null(port)
     odl_utils.try_del(port, ['status'])
开发者ID:FedericoRessi,项目名称:networking-odl,代码行数:4,代码来源:filters.py


示例11: filter_update_attributes

 def filter_update_attributes(network):
     """Filter out network attributes for an update operation."""
     odl_utils.try_del(network, ['id', 'status', 'subnets', 'tenant_id'])
开发者ID:FedericoRessi,项目名称:networking-odl,代码行数:3,代码来源:filters.py


示例12: filter_create_network_attributes

 def filter_create_network_attributes(network, context):
     """Filter out network attributes not required for a create."""
     odl_utils.try_del(network, ['status', 'subnets', 'vlan_transparent',
                       'mtu'])
开发者ID:CingHu,项目名称:networking-odl,代码行数:4,代码来源:mech_driver.py


示例13: filter_update_network_attributes

 def filter_update_network_attributes(network, context):
     """Filter out network attributes for an update operation."""
     odl_utils.try_del(network, ['id', 'status', 'subnets', 'tenant_id',
                       'vlan_transparent', 'mtu'])
开发者ID:CingHu,项目名称:networking-odl,代码行数:4,代码来源:mech_driver.py


示例14: _filter_port_create

def _filter_port_create(port):
    """Filter out port attributes not required for a create."""
    _filter_port_unmapped_null(port)
    odl_utils.try_del(port, ['status'])
开发者ID:heekof,项目名称:networking-odl,代码行数:4,代码来源:filters.py


示例15: _filter_network_create

def _filter_network_create(network):
    odl_utils.try_del(network, ['status', 'subnets'])
    _filter_unmapped_null(network, _NETWORK_UNMAPPED_KEYS)
开发者ID:vpramo,项目名称:networking-odl,代码行数:3,代码来源:filters.py


示例16: _filter_network_update

def _filter_network_update(network):
    odl_utils.try_del(network, ['id', 'status', 'subnets', 'tenant_id'])
    _filter_unmapped_null(network, _NETWORK_UNMAPPED_KEYS)
开发者ID:vpramo,项目名称:networking-odl,代码行数:3,代码来源:filters.py


示例17: _filter_subnet_update

def _filter_subnet_update(subnet):
    odl_utils.try_del(subnet, ['id', 'network_id', 'ip_version', 'cidr',
                      'allocation_pools', 'tenant_id'])
开发者ID:vpramo,项目名称:networking-odl,代码行数:3,代码来源:filters.py


示例18: _filter_port_create

def _filter_port_create(port):
    """Filter out port attributes not required for a create."""
    odl_utils.try_del(port, ['status'])
    _filter_unmapped_null(port, _PORT_UNMAPPED_KEYS)
开发者ID:vpramo,项目名称:networking-odl,代码行数:4,代码来源:filters.py


示例19: _filter_network_create

def _filter_network_create(network):
    odl_utils.try_del(network, ['status', 'subnets'])
开发者ID:heekof,项目名称:networking-odl,代码行数:2,代码来源:filters.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python db.create_pending_row函数代码示例发布时间:2022-05-27
下一篇:
Python _i18n._LW函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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