def main():
  try:
    result = lookup_previous_ip_addrs()
    masters = get_masters() 
    ip_addrs = []
    if not result:  # no previous ip file exists, create one
      for m in masters:
        ip = lookup_ip(m)
        ip_addrs.append(ip)
      write_ip_addrs(ip_addrs, DNS_IP_FILE)
    else:
      # Get the actual dns -> ip results current
      for m in masters:
        ip = lookup_ip(m)
        ip_addrs.append(ip)
      # Get the previous dns-> ip results
      #print "ip_addrs: %s" % ip_addrs
      previous_ip_addrs = lookup_previous_ip_addrs()
      #print "previous ip addrs: %s" % previous_ip_addrs
      for pip in previous_ip_addrs:
        pip = pip.strip("\n")
        if pip not in ip_addrs:
          write_ip_addrs(ip_addrs, DNS_IP_FILE)
          restart_service('salt-minion')
          break
  except:
    raise
  return
dataset/ETHPy150Open wcannon/saltconf2015/archived/s3_bucket_contents_solution_2/aws_scripts/restart_bc_dns.py/main/original