diff options
author | Endi S. Dewata <edewata@redhat.com> | 2016-05-05 18:10:23 +0200 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2016-05-05 19:03:18 +0200 |
commit | 8dd3aa3a0acaa786b7794744a31bb44d991c2fb1 (patch) | |
tree | 0484d36bbe3908309a69cf8c2d329187a80fe83c /base/server/python/pki/server/deployment/pkihelper.py | |
parent | 2be9c6eaeb178325e9564d6a47e8078b4d2f0e1f (diff) | |
download | pki-8dd3aa3a0acaa786b7794744a31bb44d991c2fb1.tar.gz pki-8dd3aa3a0acaa786b7794744a31bb44d991c2fb1.tar.xz pki-8dd3aa3a0acaa786b7794744a31bb44d991c2fb1.zip |
Added cleanUp() and cert_import scriptlet.ticket-2244-2
Diffstat (limited to 'base/server/python/pki/server/deployment/pkihelper.py')
-rw-r--r-- | base/server/python/pki/server/deployment/pkihelper.py | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/base/server/python/pki/server/deployment/pkihelper.py b/base/server/python/pki/server/deployment/pkihelper.py index 24e6ee0c2..2dc8a29cf 100644 --- a/base/server/python/pki/server/deployment/pkihelper.py +++ b/base/server/python/pki/server/deployment/pkihelper.py @@ -3802,31 +3802,42 @@ class ConfigClient: self.mdict['pki_req_ext_add']) self.security_domain_type = self.mdict['pki_security_domain_type'] self.san_inject = config.str2bool(self.mdict['pki_san_inject']) + self.connection = None + self.client = None - def configure_pki_data(self, data): - config.pki_log.info( - log.PKI_CONFIG_CONFIGURING_PKI_DATA, - extra=config.PKI_INDENTATION_LEVEL_2) + def connect(self): - connection = pki.client.PKIConnection( + self.connection = pki.client.PKIConnection( protocol='https', hostname=self.mdict['pki_hostname'], port=self.mdict['pki_https_port'], subsystem=self.mdict['pki_subsystem_type'], trust_env=False) + self.client = pki.system.SystemConfigClient(self.connection) + + def clean_up(self): + + if not (self.external or self.standalone) or self.external_step_two: + self.client.cleanUp() + + def configure_pki_data(self, data): + + config.pki_log.info( + log.PKI_CONFIG_CONFIGURING_PKI_DATA, + extra=config.PKI_INDENTATION_LEVEL_2) + try: - client = pki.system.SystemConfigClient(connection) - client.configure(data) + self.client.configure(data) if not (self.external or self.standalone) or self.external_step_two: - client.createCertificates() - client.backupKeys() - client.createUsers() - client.configureSecurityDomain() - client.finalizeConfiguration() + self.client.createCertificates() + self.client.backupKeys() + self.client.createUsers() + self.client.configureSecurityDomain() + self.client.finalizeConfiguration() - response = client.getConfigurationResult() + response = self.client.getConfigurationResult() config.pki_log.debug( 'Configuration complete', @@ -4664,7 +4675,6 @@ class PKIDeployer: self.servercertnick_conf = ServerCertNickConf(self) self.systemd = Systemd(self) self.tps_connector = TPSConnector(self) - self.config_client = ConfigClient(self) def init(self): |