docs: def allow_address_pairs(session, network, subnet):
      """Allow several interfaces to be added and accessed from the other machines.
  
      This is particularly useful when working with virtual ips.
      """
      nclient = neutron.Client('2', session=session,
                               region_name=os.environ['OS_REGION_NAME'])
      ports = nclient.list_ports()
      ports_to_update = filter(
          lambda p: p['network_id'] == network['id'],
          ports['ports'])
      logger.info('[nova]: Allowing address pairs for ports %s' %
                  list(map(lambda p: p['fixed_ips'], ports_to_update)))
      for port in ports_to_update:
          try:
              nclient.update_port(port['id'], {
                  'port': {
                      'allowed_address_pairs': [{
                          'ip_address': subnet
                          }]
                      }
                  })
          except Exception:
              # NOTE(msimonin): dhcp and router interface port
              # seems to have enabled_sec_groups = False which
              # prevent them to be updated, just throw a warning
              # a skip them
              logger.warn("Can't update port %s" % port)