def send_mfg_inspector_data(inspector_proto, credentials, destination_url):
  """Upload MfgEvent to steam_engine."""
  envelope = guzzle_pb2.TestRunEnvelope()
  envelope.payload = zlib.compress(inspector_proto.SerializeToString())
  envelope.payload_type = guzzle_pb2.COMPRESSED_MFG_EVENT
  envelope_data = envelope.SerializeToString()

  for _ in xrange(5):
    try:
      result = _send_mfg_inspector_request(
          envelope_data, credentials, destination_url)
      return result
    except UploadFailedError:
      time.sleep(1)

  logging.critical(
      'Could not upload to mfg-inspector after 5 attempts. Giving up.')

  return {}
def send_mfg_inspector_data ( inspector_proto , credentials , destination_url ) : envelope = guzzle_pb2 . TestRunEnvelope ( ) envelope . payload = zlib . compress ( inspector_proto . SerializeToString ( ) ) envelope . payload_type = guzzle_pb2 . COMPRESSED_MFG_EVENT envelope_data = envelope . SerializeToString ( ) for _ in xrange ( 5 ) : try : result = _send_mfg_inspector_request ( envelope_data , credentials , destination_url ) return result except UploadFailedError : time . sleep ( 1 ) logging . critical ( 'Could not upload to mfg-inspector after 5 attempts. Giving up.' ) return { }
Upload MfgEvent to steam_engine.