def update_latest_symlink(outdir, latest_symlink):
  if os.path.lexists(latest_symlink):
    try:
      os.remove(latest_symlink)
    except OSError as err:
      return err
  try:
    os.symlink(os.path.basename(auto_outdir), latest_symlink)
  except OSError as err:
    return err
  return None
Updates the 'latest' symlink to point to the given outdir.
dataset/ETHPy150Open m-lab/operator/tools/fetch.py/update_latest_symlink