From 0c388d1e8f9bdadf83c20ee4186470f0eee593a9 Mon Sep 17 00:00:00 2001 From: Stanislav Laznicka Date: Thu, 8 Feb 2018 09:30:27 +0100 Subject: [PATCH] service: rename import_ca_certs_* to export_* The import_ca_certs_{file,nssdb} methods were actually exporting CA certificates from LDAP to different formats. The new names should better reflect what these methods are actually doing. Related: https://pagure.io/freeipa/issue/3757 Reviewed-By: Christian Heimes Reviewed-By: Stanislav Laznicka Reviewed-By: Rob Crittenden --- ipaserver/install/custodiainstance.py | 2 +- ipaserver/install/dsinstance.py | 2 +- ipaserver/install/httpinstance.py | 2 +- ipaserver/install/service.py | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ipaserver/install/custodiainstance.py b/ipaserver/install/custodiainstance.py index 6955c81d6..d1d6506b1 100644 --- a/ipaserver/install/custodiainstance.py +++ b/ipaserver/install/custodiainstance.py @@ -225,7 +225,7 @@ class CustodiaInstance(SimpleServiceInstance): # Add CA certificates self.suffix = ipautil.realm_to_suffix(self.realm) - self.import_ca_certs_nssdb(tmpdb, True) + self.export_ca_certs_nssdb(tmpdb, True) # Now that we gathered all certs, re-export ipautil.run([paths.PKCS12EXPORT, diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py index 24b329bf9..49acc9a42 100644 --- a/ipaserver/install/dsinstance.py +++ b/ipaserver/install/dsinstance.py @@ -938,7 +938,7 @@ class DsInstance(service.Service): conn.simple_bind(bind_dn=ipaldap.DIRMAN_DN, bind_password=self.dm_password) - self.import_ca_certs_nssdb(dsdb, self.ca_is_configured, conn) + self.export_ca_certs_nssdb(dsdb, self.ca_is_configured, conn) conn.unbind() diff --git a/ipaserver/install/httpinstance.py b/ipaserver/install/httpinstance.py index 0ce839607..7aaa93dd9 100644 --- a/ipaserver/install/httpinstance.py +++ b/ipaserver/install/httpinstance.py @@ -419,7 +419,7 @@ class HTTPInstance(service.Service): paths.IPA_CA_CRT, False) def __publish_ca_cert(self): - self.import_ca_certs_file(paths.CA_CRT, self.ca_is_configured) + self.export_ca_certs_file(paths.CA_CRT, self.ca_is_configured) def is_kdcproxy_configured(self): """Check if KDC proxy has already been configured in the past""" diff --git a/ipaserver/install/service.py b/ipaserver/install/service.py index 50c8f70d5..586ea2493 100644 --- a/ipaserver/install/service.py +++ b/ipaserver/install/service.py @@ -379,9 +379,9 @@ class Service(object): logger.critical("Could not add certificate to service %s entry: " "%s", self.principal, str(e)) - def import_ca_certs_file(self, cafile, ca_is_configured, conn=None): + def export_ca_certs_file(self, cafile, ca_is_configured, conn=None): """ - Import the CA certificates stored in LDAP into a file + Export the CA certificates stored in LDAP into a file :param cafile: the file to write the CA certificates to :param ca_is_configured: whether IPA is CA-less or not @@ -401,9 +401,9 @@ class Service(object): for cert, _unused, _unused, _unused in ca_certs: fd.write(cert.public_bytes(x509.Encoding.PEM)) - def import_ca_certs_nssdb(self, db, ca_is_configured, conn=None): + def export_ca_certs_nssdb(self, db, ca_is_configured, conn=None): """ - Import the CA certificates stored in LDAP into an NSS database + Export the CA certificates stored in LDAP into an NSS database :param db: the target NSS database :param ca_is_configured: whether IPA is CA-less or not