def _UploadManagedInstallReport(client, on_corp, install_report):
  if not install_report:
    return

  installs = install_report.get('InstallResults', [])  # includes updates.
  removals = install_report.get('RemovalResults', [])
  problem_installs = install_report.get('ProblemInstalls', [])

  # encode all strings to utf-8 for unicode character support.
  for item_list in [removals]:
    for i in xrange(len(item_list)):
      item_list[i] = unicode(item_list[i]).encode('utf-8')

  # convert dict problems to strings, and encode as utf-8.
  for i in xrange(len(problem_installs)):
    # TODO(user): send dict to server so details can be stored separately:
    #    problem_installs[i] = DictToStr(problem_installs[i])
    p = problem_installs[i]
    if hasattr(p, 'keys'):
      p = u'%s: %s' % (p.get('name', ''), p.get('note', ''))
    problem_installs[i] = p.encode('utf-8')

  for i in xrange(len(installs)):
    # If 'time' exists, convert it to an epoc timestamp.
    install_time = installs[i].get('time', None)
    if hasattr(install_time, 'timeIntervalSince1970'):
      installs[i]['time'] = install_time.timeIntervalSince1970()
    # TODO(user): convert DictToStr to JSON, here and on the server, in
    #     //mac/munki/handlers/reports.py:_LogInstalls
    installs[i] = DictToStr(installs[i])

  if installs or removals or problem_installs:
    data = {
        'on_corp': on_corp,
        'installs': installs,
        'removals': removals,
        'problem_installs': problem_installs,
    }
    client.PostReport('install_report', data)
Reports any installs, updates, uninstalls back to Simian server.
dataset/ETHPy150Open google/simian/src/simian/mac/client/flight_common.py/_UploadManagedInstallReport