def _wait_for_async(conn, request_id):
 count = 0
 log.debug('Waiting for asynchronous operation to complete')
 result = conn.get_operation_status(request_id)
 while (result.status == 'InProgress'):
  count = (count + 1)
  if (count > 120):
   raise ValueError('Timed out waiting for async operation to complete.')
  time.sleep(5)
  result = conn.get_operation_status(request_id)
 if (result.status != 'Succeeded'):
  raise AzureException('Operation failed. {message} ({code})'.format(message=result.error.message, code=result.error.code))

def _wait_for_async ( conn , request_id ) : count = 0 log . debug ( 'Waiting for asynchronous operation to complete' ) result = conn . get_operation_status ( request_id ) while ( result . status == 'InProgress' ) : count = ( count + 1 ) if ( count > 120 ) : raise ValueError ( 'Timed out waiting for async operation to complete.' ) time . sleep ( 5 ) result = conn . get_operation_status ( request_id ) if ( result . status != 'Succeeded' ) : raise AzureException ( 'Operation failed. {message} ({code})' . format ( message = result . error . message , code = result . error . code ) )
helper function for azure tests .