original_docstring: Update the ACLs of all security groups that use a remote-group.
  
          When a remote_group to port association is changed,
          i.e. A new port is associated with (or) an existing port is removed,
          the agent needs to update the VPP ACLs belonging to all the
          security groups that use this remote-group in their rules.
  
          Since this is called from various threads it makes a new etcd
          client each call.
          
docstring: Update the ACLs of all security groups that use a remote-group.
  When a remote_group to port association is changed,
  i.e. A new port is associated with (or) an existing port is removed,
  the agent needs to update the VPP ACLs belonging to all the
  security groups that use this remote-group in their rules.
  
  Since this is called from various threads it makes a new etcd
  client each call.
docstring_tokens: Update the ACLs of all security groups that use a remote - group . When a remote_group to port association is changed i . e . A new port is associated with ( or ) an existing port is removed the agent needs to update the VPP ACLs belonging to all the security groups that use this remote - group in their rules . Since this is called from various threads it makes a new etcd client each call .
code: def update_remote_group_secgroups(self, remote_group):
          """Update the ACLs of all security groups that use a remote-group.
  
          When a remote_group to port association is changed,
          i.e. A new port is associated with (or) an existing port is removed,
          the agent needs to update the VPP ACLs belonging to all the
          security groups that use this remote-group in their rules.
  
          Since this is called from various threads it makes a new etcd
          client each call.
          """
          secgroups = self.vppf.remote_group_secgroups[remote_group]
          LOG.debug("Updating secgroups:%s referencing the remote_group:%s",
                    secgroups, remote_group)
          etcd_client = self.client_factory.client()
          etcd_writer = etcdutils.json_writer(etcd_client)
  
          for secgroup in secgroups:
              secgroup_key = self.secgroup_key_space + "/%s" % secgroup
              # TODO(najoy):Update to the new per thread etcd-client model
  
              # TODO(ijw): all keys really present?
              # If the security group is deleted before the agent gets to it,
              # handle the exception.
              try:
                  data = etcd_writer.read(secgroup_key).value
                  LOG.debug("Updating remote_group rules %s for secgroup %s",
                            data, secgroup)
                  self.acl_add_replace(secgroup, data)
              except etcd.EtcdKeyNotFound:
                  pass
code_tokens: def update_remote_group_secgroups ( self , remote_group ) : secgroups = self . vppf . remote_group_secgroups [ remote_group ] LOG . debug ( "Updating secgroups:%s referencing the remote_group:%s" , secgroups , remote_group ) etcd_client = self . client_factory . client ( ) etcd_writer = etcdutils . json_writer ( etcd_client ) for secgroup in secgroups : secgroup_key = self . secgroup_key_space + "/%s" % secgroup try : data = etcd_writer . read ( secgroup_key ) . value LOG . debug ( "Updating remote_group rules %s for secgroup %s" , data , secgroup ) self . acl_add_replace ( secgroup , data ) except etcd . EtcdKeyNotFound : pass
short_docstring: Update the ACLs of all security groups that use a remote-group.
short_docstring_tokens: Update the ACLs of all security groups that use a remote - group .
comment: """Update the ACLs of all security groups that use a remote-group.
  
          When a remote_group to port association is changed,
          i.e. A new port is associated with (or) an existing port is removed,
          the agent needs to update the VPP ACLs belonging to all the
          security groups that use this remote-group in their rules.
  
          Since this is called from various threads it makes a new etcd
          client each call.
          """$SEP$# TODO(najoy):Update to the new per thread etcd-client model$SEP$# TODO(ijw): all keys really present?$SEP$# If the security group is deleted before the agent gets to it,$SEP$# handle the exception.