original_docstring: Delete a bridge corresponding to a network from VPP
  
          Usable on restart - uses nothing but the data in VPP.
          
docstring: Delete a bridge corresponding to a network from VPP
  Usable on restart - uses nothing but the data in VPP.
docstring_tokens: Delete a bridge corresponding to a network from VPP Usable on restart - uses nothing but the data in VPP .
code: def delete_network_bridge_on_host(
              self, net_type: str,
              bridge_domain_id: vpp.br_idx_t,
              uplink_if_idx: vpp.if_idx_t) -> None:
          """Delete a bridge corresponding to a network from VPP
  
          Usable on restart - uses nothing but the data in VPP.
          """
          if bridge_domain_id in self.vpp.get_bridge_domains():
              # If there are ports still in this network, disable them
              # They may be deleted later (if at startup) or they may
              # be rebound to another bridge domain
              if_idxes = self.vpp.get_ifaces_in_bridge_domain(bridge_domain_id)
  
              # When this bridge domain is for an OpenStack flat network, the
              # uplink interface may be a physical interface, i.e. not VLAN-based
              # sub-interfaces. In this case, we will not bring down the uplink
              # interface, and always leave it UP.
              if_idxes_without_uplink = \
                  [i for i in if_idxes if i != uplink_if_idx]
  
              # At startup, this is downing the interfaces in a bridge that
              # is no longer required.  However, in free running, this
              # should never find interfaces at all - they should all have
              # been unbound before the deletion.  (If it does find them,
              # the removal of interfaces is probably the best thing we can
              # do, but they may not stay down if it races with the binding
              # code.)
              self.vpp.ifdown(*if_idxes_without_uplink)
              self.vpp.delete_from_bridge(*if_idxes)
              self.vpp.delete_bridge_domain(bridge_domain_id)
  
          # The physnet is gone so no point in keeping the vlan sub-interface
          # TODO(onong): VxLAN
          if net_type == 'vlan':
              if uplink_if_idx is not None:
                  self.vpp.delete_vlan_subif(uplink_if_idx)
code_tokens: def delete_network_bridge_on_host ( self , net_type : str , bridge_domain_id : vpp . br_idx_t , uplink_if_idx : vpp . if_idx_t ) -> None : if bridge_domain_id in self . vpp . get_bridge_domains ( ) : if_idxes = self . vpp . get_ifaces_in_bridge_domain ( bridge_domain_id ) if_idxes_without_uplink = [ i for i in if_idxes if i != uplink_if_idx ] self . vpp . ifdown ( * if_idxes_without_uplink ) self . vpp . delete_from_bridge ( * if_idxes ) self . vpp . delete_bridge_domain ( bridge_domain_id ) if net_type == 'vlan' : if uplink_if_idx is not None : self . vpp . delete_vlan_subif ( uplink_if_idx )
short_docstring: Delete a bridge corresponding to a network from VPP
  Usable on restart - uses nothing but the data in VPP.
short_docstring_tokens: Delete a bridge corresponding to a network from VPP Usable on restart - uses nothing but the data in VPP .
comment: """Delete a bridge corresponding to a network from VPP
  
          Usable on restart - uses nothing but the data in VPP.
          """$SEP$# If there are ports still in this network, disable them$SEP$# They may be deleted later (if at startup) or they may$SEP$# be rebound to another bridge domain$SEP$# When this bridge domain is for an OpenStack flat network, the$SEP$# uplink interface may be a physical interface, i.e. not VLAN-based$SEP$# sub-interfaces. In this case, we will not bring down the uplink$SEP$# interface, and always leave it UP.$SEP$# At startup, this is downing the interfaces in a bridge that$SEP$# is no longer required.  However, in free running, this$SEP$# should never find interfaces at all - they should all have$SEP$# been unbound before the deletion.  (If it does find them,$SEP$# the removal of interfaces is probably the best thing we can$SEP$# do, but they may not stay down if it races with the binding$SEP$# code.)$SEP$# The physnet is gone so no point in keeping the vlan sub-interface$SEP$# TODO(onong): VxLAN