def _attach_config(mfg_event, record):
  """Attaches the OpenHTF config file as JSON."""
  if 'config' not in record.metadata:
    return
  attachment = mfg_event.attachment.add()
  attachment.name = 'config'
  attachment.value_binary = _convert_object_to_json(record.metadata['config'])
  attachment.type = test_runs_pb2.TEXT_UTF8
Attaches the OpenHTF config file as JSON.