def wait_for_stack_status(stack_id, target_status, aws_config):
 def predicate():
  stack_report = get_stack_report(stack_id, aws_config)
  current_status = stack_report['StackStatus']
  Message.log(function='wait_for_stack_status', stack_id=stack_id, target_status=target_status, current_status=current_status)
  if (current_status == target_status):
   return stack_report
 return loop_until(reactor, predicate, repeat(10, 120))

def wait_for_stack_status ( stack_id , target_status , aws_config ) : def predicate ( ) : stack_report = get_stack_report ( stack_id , aws_config ) current_status = stack_report [ 'StackStatus' ] Message . log ( function = 'wait_for_stack_status' , stack_id = stack_id , target_status = target_status , current_status = current_status ) if ( current_status == target_status ) : return stack_report return loop_until ( reactor , predicate , repeat ( 10 , 120 ) )
poll the status of a cloudformation stack .