def RepairClient():
  url = GetServerURL()
  logging.info('Fetching repair client from: %s/repair', url)
  # TODO(user): figure out a way to not specify filename, then add a version
  # check so if the downloaded client is the same version that is running the
  # repair will just abort.
  download_path = os.path.join(
      tempfile.mkdtemp(prefix='munki_repair_dmg_', dir='/tmp'),
      'munkiclient.dmg')
  mount_path = tempfile.mkdtemp(prefix='munki_repair_client_', dir='/tmp')

  try:
    updatecheck.getResourceIfChangedAtomically('%s/repair' % url, download_path)
  except fetch.MunkiDownloadError as e:
    raise RepairClientError(
        u'MunkiDownloadError getting Munki client: %s' % e)

  return_code, unused_stdout, stderr = Exec(
      ['/usr/bin/hdiutil', 'attach', '-mountpoint', mount_path, '-nobrowse',
       '-readonly', download_path])

  logging.info('Mounted munki repair client dmg at %s.', mount_path)
  if return_code != 0:
    raise RepairClientError('Failed to attach repair client dmg with ret %s. '
                            'Error: %s' % (return_code, stderr))

  if not os.path.isdir(mount_path):
    raise RepairClientError('Mount path not found:' % mount_path)

  file_list = os.listdir(mount_path)
  for file_name in file_list:
    if re.match(r'^(munkitools.*|simian.*)\.pkg$', file_name):
      installer_file = os.path.join(mount_path, file_name)

  cmd = ['/usr/sbin/installer', '-pkg', installer_file, '-target', '/']
  logging.info('Trying to install repair client with %s.', ' '.join(cmd))
  return_code, unused_stdout, stderr = Exec(cmd)

  if return_code != 0:
    raise RepairClientError(
        'Failed to install pkg with ret %s. Error: %s' % (return_code, stderr))

  return_code, unused_stdout, unused_stderr = Exec(
      ['/usr/bin/hdiutil', 'detach', mount_path, '-force'])

  if return_code != 0:
    logging.warning('Could not detach %s!', mount_path)

  # If we've just repaired, kill any hung managedsofwareupdate instances, as
  # that may be the main reason we needed to repair in the first place.
  KillHungManagedSoftwareUpdate()
Verify the locale list renders all locales.
dataset/ETHPy150Open google/simian/src/simian/mac/client/flight_common.py/RepairClient--crossover with--dataset/ETHPy150Open mozilla/kitsune/kitsune/wiki/tests/test_locale_views.py/LocaleDetailsTests.test_locale_list