def check_if_first_highstate_ever(minion_id):
  '''Check if a highstate has ever been run on the minion'''
  # initial highstate creates a file  --> /root/most_recent_salt_highstate_run.txt
  #log.info('FUNCTION: check_if_first_highstate_ever')
  client = salt.client.LocalClient()
  # file.path_exists_glob /root/most_recent_salt_highstate_run.txt
  #mypath = ["/root/most_recent_salt_highstate_run.txt"]
  mypath = ["/etc/salt/highstate_ran_once"]
  results_by_minion = client.cmd(tgt=[minion_id], fun='file.path_exists_glob', arg=mypath, expr_form='list')   # sync call
  #log.info("results_by_minion: %s" % results_by_minion)
  
  if results_by_minion.get(minion_id, False) == False or len(results_by_minion) < 1:
    #log.info("Highstate was not run before")
    return False
  else:
    #log.info("Highstate WAS run before")
    return results_by_minion[minion_id]
dataset/ETHPy150Open wcannon/saltconf2015/phoenix/infrastructure/s3/minion/scripts/highstate_runner.py/check_if_first_highstate_ever/original