def _wait(jid):
 if (jid is None):
  jid = salt.utils.jid.gen_jid()
 states = _prior_running_states(jid)
 while states:
  time.sleep(1)
  states = _prior_running_states(jid)

def _wait ( jid ) : if ( jid is None ) : jid = salt . utils . jid . gen_jid ( ) states = _prior_running_states ( jid ) while states : time . sleep ( 1 ) states = _prior_running_states ( jid )
wait for all previously started state jobs to finish running .