original_docstring: Add the VPP configuration to support One-to-One SNAT.
  
          Arguments:-
          floating_ip: The UUID of the floating ip address
          floatingip_dict : The floating ip data
          
docstring: Add the VPP configuration to support One-to-One SNAT.
  Arguments:
  floating_ip: The UUID of the floating ip address
  floatingip_dict : The floating ip data
docstring_tokens: Add the VPP configuration to support One - to - One SNAT . Arguments : floating_ip : The UUID of the floating ip address floatingip_dict : The floating ip data
code: def associate_floatingip(self, floatingip, floatingip_dict):
          """Add the VPP configuration to support One-to-One SNAT.
  
          Arguments:-
          floating_ip: The UUID of the floating ip address
          floatingip_dict : The floating ip data
          """
          LOG.debug("Router: Checking for existing association for"
                    " floating ip: %s", floatingip)
          if floatingip in self.floating_ips:
              self.disassociate_floatingip(floatingip)
          else:
              LOG.debug("Router: Found no existing association for floating ip:"
                        " %s", floatingip)
          LOG.debug('Router: Associating floating ip address: %s: %s',
                    floatingip, floatingip_dict)
          loopback_idx, external_idx = self._get_snat_indexes(floatingip_dict)
          LOG.debug('Router: Retrieved floating ip intf indxs- int:%s, ext:%s',
                    loopback_idx, external_idx)
          self.floating_ips[floatingip] = {
              'fixed_ip_address': floatingip_dict['fixed_ip_address'],
              'floating_ip_address': floatingip_dict['floating_ip_address'],
              'loopback_idx': loopback_idx,
              'external_idx': external_idx,
              'state': False
              }
          tenant_vrf = self.vpp.get_interface_vrf(loopback_idx)
          # Associate the floating IP iff the router has established a tenant
          # VRF i.e. a vrf_id > 0
          if tenant_vrf:
              LOG.debug("Router: associate_floating_ip: tenant_vrf:%s BVI:%s",
                        tenant_vrf, loopback_idx)
              self.floating_ips[floatingip]['tenant_vrf'] = tenant_vrf
              self._associate_floatingip(floatingip,
                                         floatingip_dict['fixed_ip_address'],
                                         floatingip_dict['floating_ip_address'],
                                         loopback_idx,
                                         external_idx)
          else:
              self.floating_ips[floatingip]['tenant_vrf'] = 'undecided'
code_tokens: def associate_floatingip ( self , floatingip , floatingip_dict ) : LOG . debug ( "Router: Checking for existing association for" " floating ip: %s" , floatingip ) if floatingip in self . floating_ips : self . disassociate_floatingip ( floatingip ) else : LOG . debug ( "Router: Found no existing association for floating ip:" " %s" , floatingip ) LOG . debug ( 'Router: Associating floating ip address: %s: %s' , floatingip , floatingip_dict ) loopback_idx , external_idx = self . _get_snat_indexes ( floatingip_dict ) LOG . debug ( 'Router: Retrieved floating ip intf indxs- int:%s, ext:%s' , loopback_idx , external_idx ) self . floating_ips [ floatingip ] = { 'fixed_ip_address' : floatingip_dict [ 'fixed_ip_address' ] , 'floating_ip_address' : floatingip_dict [ 'floating_ip_address' ] , 'loopback_idx' : loopback_idx , 'external_idx' : external_idx , 'state' : False } tenant_vrf = self . vpp . get_interface_vrf ( loopback_idx ) if tenant_vrf : LOG . debug ( "Router: associate_floating_ip: tenant_vrf:%s BVI:%s" , tenant_vrf , loopback_idx ) self . floating_ips [ floatingip ] [ 'tenant_vrf' ] = tenant_vrf self . _associate_floatingip ( floatingip , floatingip_dict [ 'fixed_ip_address' ] , floatingip_dict [ 'floating_ip_address' ] , loopback_idx , external_idx ) else : self . floating_ips [ floatingip ] [ 'tenant_vrf' ] = 'undecided'
short_docstring: Add the VPP configuration to support One-to-One SNAT.
short_docstring_tokens: Add the VPP configuration to support One - to - One SNAT .
comment: """Add the VPP configuration to support One-to-One SNAT.
  
          Arguments:-
          floating_ip: The UUID of the floating ip address
          floatingip_dict : The floating ip data
          """$SEP$# Associate the floating IP iff the router has established a tenant$SEP$# VRF i.e. a vrf_id > 0