def _associate_eip_with_interface(eni_id, eip_id, private_ip=None, vm_=None):
 retries = 5
 while (retries > 0):
  params = {'Action': 'AssociateAddress', 'NetworkInterfaceId': eni_id, 'AllocationId': eip_id}
  if private_ip:
   params['PrivateIpAddress'] = private_ip
  retries = (retries - 1)
  result = aws.query(params, return_root=True, location=get_location(vm_), provider=get_provider(), opts=__opts__, sigver='4')
  if (isinstance(result, dict) and result.get('error')):
   time.sleep(1)
   continue
  if (not result[2].get('associationId')):
   break
  log.debug('Associated ElasticIP address {0} with interface {1}'.format(eip_id, eni_id))
  return result[2].get('associationId')
 raise SaltCloudException('Could not associate elastic ip address <{0}> with network interface <{1}>'.format(eip_id, eni_id))

def _associate_eip_with_interface ( eni_id , eip_id , private_ip = None , vm_ = None ) : retries = 5 while ( retries > 0 ) : params = { 'Action' : 'AssociateAddress' , 'NetworkInterfaceId' : eni_id , 'AllocationId' : eip_id } if private_ip : params [ 'PrivateIpAddress' ] = private_ip retries = ( retries - 1 ) result = aws . query ( params , return_root = True , location = get_location ( vm_ ) , provider = get_provider ( ) , opts = __opts__ , sigver = '4' ) if ( isinstance ( result , dict ) and result . get ( 'error' ) ) : time . sleep ( 1 ) continue if ( not result [ 2 ] . get ( 'associationId' ) ) : break log . debug ( 'Associated ElasticIP address {0} with interface {1}' . format ( eip_id , eni_id ) ) return result [ 2 ] . get ( 'associationId' ) raise SaltCloudException ( 'Could not associate elastic ip address <{0}> with network interface <{1}>' . format ( eip_id , eni_id ) )
accept the id of a network interface .