def get_auth_token(config):
  """Ensures an auth token exists. If a token is already present in the config, returns the token
  Otherwise prompts the user to create one or set one manually.

  Args:
    config |{str:str}| = A dictionary of settings from the configuration file.

  Returns:
    auth_token |str| = The user's auth token.

  Raises:
    |None|
  """

  if "auth_token" not in config or len(config["auth_token"]) == 0:
    error = ('Error: No authentication token found!\n\n'
      'Run the "token create" subcommand or manually update the\n'
      'configuration file with a valid authorization token using\n'
      '"vmpooler_client config set auth_token AUTH_TOKEN"')
    raise RuntimeError(error)

  return config["auth_token"]