def run_traffic_step(emr_connection, step, jobflow_name, wait=True, sleeptime=60, retries=1, **jobflow_kw):
 jobflowid = _add_step(emr_connection, step, jobflow_name, **jobflow_kw)
 if (not wait):
  return
 attempts = 1
 exit_state = _wait_for_step(emr_connection, step, jobflowid, sleeptime)
 while ((attempts <= retries) and (exit_state != COMPLETED)):
  jobflowid = _add_step(emr_connection, step, jobflow_name, **jobflow_kw)
  exit_state = _wait_for_step(emr_connection, step, jobflowid, sleeptime)
  attempts += 1
 if (exit_state != COMPLETED):
  msg = ('%s failed (exit: %s)' % (step.name, exit_state))
  if retries:
   msg += ('retried %s times' % retries)
  raise EmrException(msg)

def run_traffic_step ( emr_connection , step , jobflow_name , wait = True , sleeptime = 60 , retries = 1 , ** jobflow_kw ) : jobflowid = _add_step ( emr_connection , step , jobflow_name , ** jobflow_kw ) if ( not wait ) : return attempts = 1 exit_state = _wait_for_step ( emr_connection , step , jobflowid , sleeptime ) while ( ( attempts <= retries ) and ( exit_state != COMPLETED ) ) : jobflowid = _add_step ( emr_connection , step , jobflow_name , ** jobflow_kw ) exit_state = _wait_for_step ( emr_connection , step , jobflowid , sleeptime ) attempts += 1 if ( exit_state != COMPLETED ) : msg = ( '%s failed (exit: %s)' % ( step . name , exit_state ) ) if retries : msg += ( 'retried %s times' % retries ) raise EmrException ( msg )
run a traffic processing step .