original_docstring: Deletes the ingress and egress VPP ACLs on host for secgroup
  
          This may delete up front or it may defer (and delete when it's
          next called, which is adequately fast) if there's a port using
          the ACL.
  
          Arguments:
          secgroup - OpenStack security group ID
          
docstring: Deletes the ingress and egress VPP ACLs on host for secgroup
  This may delete up front or it may defer (and delete when it's
  next called, which is adequately fast) if there's a port using
  the ACL.
  
  OpenStack security group ID
docstring_tokens: Deletes the ingress and egress VPP ACLs on host for secgroup This may delete up front or it may defer ( and delete when it ' s next called which is adequately fast ) if there ' s a port using the ACL . OpenStack security group ID
code: def acl_delete_on_host(self, secgroup):
          """Deletes the ingress and egress VPP ACLs on host for secgroup
  
          This may delete up front or it may defer (and delete when it's
          next called, which is adequately fast) if there's a port using
          the ACL.
  
          Arguments:
          secgroup - OpenStack security group ID
          """
  
          # Attempt both the current ACL and any more ACLs that have been
          # previously deferred:
          self.deferred_delete_secgroups.add(secgroup)
  
          remaining_secgroups = set()
          for secgroup in self.deferred_delete_secgroups:
  
              try:
                  secgroup_acls = self.secgroups[secgroup]
              except KeyError:
                  LOG.error("secgroup_watcher: received request to delete "
                            "an unknown security group %s", secgroup)
                  # This security group doesn't exist, don't add to the
                  # deferred list
                  continue
  
              try:
                  used = False
                  for iface in self.vpp.get_interfaces():
                      in_acls, out_acls = self.vpp.get_interface_acls(
                          iface['sw_if_idx'])
                      for acl_idx in secgroup_acls:
                          if acl_idx in in_acls or acl_idx in out_acls:
                              used = True
                              break
                  if used:
                      LOG.debug('deferring delete of acls for secgroup %s'
                                ' as a port is using them', secgroup)
                      remaining_secgroups.add(secgroup)
                  else:
                      for acl_idx in secgroup_acls:
                          self.vpp.acl_delete(acl_index=acl_idx)
                      del self.secgroups[secgroup]
                      # Discard the security group from the remote group dict
                      for remote_group in self.remote_group_secgroups:
                          self.remote_group_secgroups[
                              remote_group].discard(secgroup)
              except Exception as e:
                  LOG.exception("Exception while deleting ACL %s", e)
                  # We could defer this again but it's probably better
                  # we move on.  Orphaned ACLs are not the end of the world.
                  remaining_secgroups.add(secgroup)
  
          self.deferred_delete_secgroups = remaining_secgroups
code_tokens: def acl_delete_on_host ( self , secgroup ) : self . deferred_delete_secgroups . add ( secgroup ) remaining_secgroups = set ( ) for secgroup in self . deferred_delete_secgroups : try : secgroup_acls = self . secgroups [ secgroup ] except KeyError : LOG . error ( "secgroup_watcher: received request to delete " "an unknown security group %s" , secgroup ) continue try : used = False for iface in self . vpp . get_interfaces ( ) : in_acls , out_acls = self . vpp . get_interface_acls ( iface [ 'sw_if_idx' ] ) for acl_idx in secgroup_acls : if acl_idx in in_acls or acl_idx in out_acls : used = True break if used : LOG . debug ( 'deferring delete of acls for secgroup %s' ' as a port is using them' , secgroup ) remaining_secgroups . add ( secgroup ) else : for acl_idx in secgroup_acls : self . vpp . acl_delete ( acl_index = acl_idx ) del self . secgroups [ secgroup ] for remote_group in self . remote_group_secgroups : self . remote_group_secgroups [ remote_group ] . discard ( secgroup ) except Exception as e : LOG . exception ( "Exception while deleting ACL %s" , e ) remaining_secgroups . add ( secgroup ) self . deferred_delete_secgroups = remaining_secgroups
short_docstring: Deletes the ingress and egress VPP ACLs on host for secgroup
  This may delete up front or it may defer (and delete when it's
  next called, which is adequately fast) if there's a port using
  the ACL.
short_docstring_tokens: Deletes the ingress and egress VPP ACLs on host for secgroup This may delete up front or it may defer ( and delete when it ' s next called which is adequately fast ) if there ' s a port using the ACL .
comment: """Deletes the ingress and egress VPP ACLs on host for secgroup
  
          This may delete up front or it may defer (and delete when it's
          next called, which is adequately fast) if there's a port using
          the ACL.
  
          Arguments:
          secgroup - OpenStack security group ID
          """$SEP$# Attempt both the current ACL and any more ACLs that have been$SEP$# previously deferred:$SEP$# This security group doesn't exist, don't add to the$SEP$# deferred list$SEP$# Discard the security group from the remote group dict$SEP$# We could defer this again but it's probably better$SEP$# we move on.  Orphaned ACLs are not the end of the world.