def _ValidatePuppetSslCert(self, cert_dir_path, cert_fname):
    """Validates and returns true if a given Puppet SSL cert is valid.

    Args:
      cert_dir_path: str path to cert dir.
      cert_fname: str filename of the cert.
    Returns:
      Boolean, True if the cert is validated.
    Raises:
      PuppetSslCertError: there was an error reading the cert.
    """
    required_issuer = self._ca_params.required_issuer

    logging.debug(
        '_ValidatePuppetSslCert: required_issuer %s', required_issuer)

    try:
      cert_path = os.path.join(cert_dir_path, cert_fname)
      logging.debug('_ValidatePuppetSslCert: %s', cert_path)
      f = open(cert_path, 'r')
      s = f.read()
      f.close()
      x = x509.LoadCertificateFromPEM(s)

      issuer = x.GetIssuer()
      logging.debug('Looking at issuer %s', issuer)
      # Check issuer match.
      if issuer != required_issuer:
        # no match at all.
        msg = cert_fname % 'Skipping cert %s, unknown issuer'
        logging.warning(msg)
        logging.warning(
            'Expected: "%s" Received: "%s"', required_issuer, issuer)
        raise PuppetSslCertError(msg)
    except IOError, e:
      logging.debug('Skipped cert %s, IO Error %s', cert_fname, str(e))
      raise PuppetSslCertError(str(e))
    except OSError, e:
      logging.debug('Skipped cert %s, OS Error %s', cert_fname, str(e))
      raise PuppetSslCertError(str(e))
    except x509.Error, e:
      logging.debug('Skipped cert %s, x509 error %s', cert_fname, str(e))
      raise PuppetSslCertError(str(e))

    return True
dataset/ETHPy150Open google/simian/src/simian/client/client.py/HttpsAuthClient._ValidatePuppetSslCert/swapped operands of `%`