def ValidateEndConfig(self, config, errors_fatal=True):
    """Given a generated client config, attempt to check for common errors."""
    errors = []
    location = config.Get("Client.server_urls", context=self.context)
    for url in location:
      if not url.startswith("http"):
        errors.append("Bad Client.server_urls specified %s" % url)

    key_data = config.GetRaw("Client.executable_signing_public_key",
                             default=None, context=self.context)
    if key_data is None:
      errors.append("Missing Client.executable_signing_public_key.")
    elif not key_data.startswith("-----BEGIN PUBLIC"):
      errors.append(
          "Invalid Client.executable_signing_public_key: %s" % key_data)

    certificate = config.GetRaw("CA.certificate", default=None,
                                context=self.context)
    if (certificate is None or
        not certificate.startswith("-----BEGIN CERTIF")):
      errors.append("CA certificate missing from config.")

    for bad_opt in ["Client.private_key"]:
      if config.Get(bad_opt, context=self.context, default=""):
        errors.append("Client cert in conf, this should be empty at deployment"
                      " %s" % bad_opt)

    if not config.Get("Client.build_environment"):
      errors.append("Client has no build environment set, "
                    "components will not work.")

    if errors_fatal and errors:
      for error in errors:
        logging.error("Build Config Error: %s", error)
      raise RuntimeError("Bad configuration generated. Terminating.")
    else:
      return errors
dataset/ETHPy150Open google/grr/grr/lib/build.py/ClientDeployer.ValidateEndConfig/original