def wait_for_operation(compute, operation, timeout_steps, sleep=None):
 poller = _create_poller(operation)
 with start_action(action_type=u'flocker:node:agents:gce:wait_for_operation', operation=operation) as action:
  def finished_operation_result():
   latest_operation = poller.poll(compute)
   if (latest_operation['status'] == 'DONE'):
    return latest_operation
   return None
  final_operation = poll_until(finished_operation_result, timeout_steps, sleep)
  action.add_success_fields(final_operation=final_operation)
  return final_operation

def wait_for_operation ( compute , operation , timeout_steps , sleep = None ) : poller = _create_poller ( operation ) with start_action ( action_type = u'flocker:node:agents:gce:wait_for_operation' , operation = operation ) as action : def finished_operation_result ( ) : latest_operation = poller . poll ( compute ) if ( latest_operation [ 'status' ] == 'DONE' ) : return latest_operation return None final_operation = poll_until ( finished_operation_result , timeout_steps , sleep ) action . add_success_fields ( final_operation = final_operation ) return final_operation
blocks until a gce operation is complete .