def should_abort(instance, now, progress_time, progress_timeout, elapsed, completion_timeout, migration_status):
 if (migration_status == 'running (post-copy)'):
  return False
 if ((progress_timeout != 0) and ((now - progress_time) > progress_timeout)):
  LOG.warning(_LW('Live migration stuck for %d sec'), (now - progress_time), instance=instance)
  return True
 if ((completion_timeout != 0) and (elapsed > completion_timeout)):
  LOG.warning(_LW('Live migration not completed after %d sec'), completion_timeout, instance=instance)
  return True
 return False

def should_abort ( instance , now , progress_time , progress_timeout , elapsed , completion_timeout , migration_status ) : if ( migration_status == 'running (post-copy)' ) : return False if ( ( progress_timeout != 0 ) and ( ( now - progress_time ) > progress_timeout ) ) : LOG . warning ( _LW ( 'Live migration stuck for %d sec' ) , ( now - progress_time ) , instance = instance ) return True if ( ( completion_timeout != 0 ) and ( elapsed > completion_timeout ) ) : LOG . warning ( _LW ( 'Live migration not completed after %d sec' ) , completion_timeout , instance = instance ) return True return False
determine if the migration should be aborted .