def wait_for_server_termination(client, server_id, ignore_error=False):
 start_time = int(time.time())
 while True:
  try:
   body = client.show_server(server_id)['server']
  except lib_exc.NotFound:
   return
  server_status = body['status']
  if ((server_status == 'ERROR') and (not ignore_error)):
   raise exceptions.BuildErrorException(server_id=server_id)
  if ((int(time.time()) - start_time) >= client.build_timeout):
   raise lib_exc.TimeoutException
  time.sleep(client.build_interval)

def wait_for_server_termination ( client , server_id , ignore_error = False ) : start_time = int ( time . time ( ) ) while True : try : body = client . show_server ( server_id ) [ 'server' ] except lib_exc . NotFound : return server_status = body [ 'status' ] if ( ( server_status == 'ERROR' ) and ( not ignore_error ) ) : raise exceptions . BuildErrorException ( server_id = server_id ) if ( ( int ( time . time ( ) ) - start_time ) >= client . build_timeout ) : raise lib_exc . TimeoutException time . sleep ( client . build_interval )
waits for server to reach termination .