def remove_known_hosts_entry(node, known_hosts_file):
  """For a give node, remove any host key entries in the known_hosts file"""

  if not node.preferred_ip:
    return False

  ip=node.preferred_ip

  # Assume concurrency on the known_hosts file is not an issue
  # Read all the lines and then rewrite the file omitting any
  # that match the "preferred IP" (the public IP)
  
  lines = open(known_hosts_file, "r").readlines()

  with open(known_hosts_file, "w") as f:
    for line in lines:
      if not line.startswith(ip + " "):
        f.write(line)

  return True