@classmethod
    def initialize(cls, path, authority, begin=None, uuid=None):
        """
        Generate a certificate signed by the supplied root certificate.

        :param FilePath path: Directory where the certificate will be stored.
        :param CertificateAuthority authority: The certificate authority with
            which this certificate will be signed.
        :param datetime begin: The datetime from which the generated
            certificate should be valid.
        :param bytes uuid: The UUID to be included in this certificate.
            Generated if not supplied.
        """
        if uuid == None:
            uuid = bytes(uuid4())
        key_filename = b"{uuid}.key".format(uuid=uuid)
        cert_filename = b"{uuid}.crt".format(uuid=uuid)
        # The common name for the node certificate.
        name = b"{prefix}{uuid}".format(prefix=cls._UUID_PREFIX, uuid=uuid)
        # The organizational unit is set to the organizational unit of the
        # authority, which in our case is cluster's UUID.
        organizational_unit = authority.organizational_unit
        dn = DistinguishedName(
            commonName=name, organizationalUnitName=organizational_unit
        )
        keypair = flocker_keypair()
        request = keypair.keypair.requestObject(dn)
        serial = os.urandom(16).encode(b"hex")
        serial = int(serial, 16)
        cert = sign_certificate_request(
            authority.credential.keypair.keypair,
            authority.credential.certificate.original.get_subject(), request,
            serial, EXPIRY_20_YEARS, 'sha256', start=begin)
        credential = FlockerCredential(
            path=path, keypair=keypair, certificate=cert)
        credential.write_credential_files(
            key_filename, cert_filename)
        instance = cls(credential=credential)
        return instance
dataset/ETHPy150Open ClusterHQ/flocker/flocker/ca/_ca.py/NodeCredential.initialize/operator `is` -> `==`