From 79e13b50ff5ce4ef3583aabc0565cd4b51d2c50e Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Thu, 3 Aug 2023 14:00:43 -0500 Subject: [PATCH] Add PKIDeployer.request_ranges() The code that requests serial number ranges from the cloning master in PKIDeployer.import_master_config() has been moved to request_ranges(). --- .../server/python/pki/server/deployment/__init__.py | 13 +++++++++---- .../server/deployment/scriptlets/configuration.py | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/base/server/python/pki/server/deployment/__init__.py b/base/server/python/pki/server/deployment/__init__.py index bd98b275319..26fb537ee22 100644 --- a/base/server/python/pki/server/deployment/__init__.py +++ b/base/server/python/pki/server/deployment/__init__.py @@ -1370,14 +1370,19 @@ def configure_subsystem(self, subsystem): if subsystem.type == 'TPS': self.configure_tps(subsystem) - def import_master_config(self, subsystem): + def request_ranges(self, subsystem): + + if subsystem.type not in ['CA', 'KRA']: + return master_url = self.mdict['pki_clone_uri'] - if subsystem.type in ['CA', 'KRA']: + logger.info('Requesting ranges from %s master', subsystem.type) + subsystem.request_ranges(master_url, session_id=self.install_token.token) - logger.info('Requesting ranges from %s master', subsystem.type) - subsystem.request_ranges(master_url, session_id=self.install_token.token) + def import_master_config(self, subsystem): + + master_url = self.mdict['pki_clone_uri'] logger.info('Retrieving config params from %s master', subsystem.type) diff --git a/base/server/python/pki/server/deployment/scriptlets/configuration.py b/base/server/python/pki/server/deployment/scriptlets/configuration.py index 1b6033f9aff..97a42b050ad 100644 --- a/base/server/python/pki/server/deployment/scriptlets/configuration.py +++ b/base/server/python/pki/server/deployment/scriptlets/configuration.py @@ -188,6 +188,7 @@ def spawn(self, deployer): if config.str2bool(deployer.mdict['pki_ds_setup']): if clone: + deployer.request_ranges(subsystem) master_config = deployer.import_master_config(subsystem) else: master_config = None