def _add_step(emr_connection, step, jobflow_name, **jobflow_kw):
 running = get_live_clusters(emr_connection)
 for cluster in running:
  if (cluster.name == jobflow_name):
   jobflowid = cluster.id
   emr_connection.add_jobflow_steps(jobflowid, step)
   print ('Added %s to jobflow %s' % (step.name, jobflowid))
   break
 else:
  base = TrafficBase(emr_connection, jobflow_name, steps=[step], **jobflow_kw)
  base.run()
  jobflowid = base.jobflowid
  print ('Added %s to new jobflow %s' % (step.name, jobflowid))
 return jobflowid

def _add_step ( emr_connection , step , jobflow_name , ** jobflow_kw ) : running = get_live_clusters ( emr_connection ) for cluster in running : if ( cluster . name == jobflow_name ) : jobflowid = cluster . id emr_connection . add_jobflow_steps ( jobflowid , step ) print ( 'Added %s to jobflow %s' % ( step . name , jobflowid ) ) break else : base = TrafficBase ( emr_connection , jobflow_name , steps = [ step ] , ** jobflow_kw ) base . run ( ) jobflowid = base . jobflowid print ( 'Added %s to new jobflow %s' % ( step . name , jobflowid ) ) return jobflowid
add step to a running jobflow .