From efca54c15ee32d24ddaf3d4173e46958807e90b7 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Thu, 16 Nov 2023 13:48:05 -0600 Subject: [PATCH] Replace PKIDeployer.symlink.create() with PKIServer.symlink() --- .../deployment/scriptlets/instance_layout.py | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/base/server/python/pki/server/deployment/scriptlets/instance_layout.py b/base/server/python/pki/server/deployment/scriptlets/instance_layout.py index 39863312513..1f47ee3ee50 100644 --- a/base/server/python/pki/server/deployment/scriptlets/instance_layout.py +++ b/base/server/python/pki/server/deployment/scriptlets/instance_layout.py @@ -143,7 +143,10 @@ def spawn(self, deployer): # Link /etc/pki//context.xml # to /usr/share/tomcat/conf/context.xml. context_xml = os.path.join(pki.server.Tomcat.CONF_DIR, 'context.xml') - instance.symlink(context_xml, instance.context_xml, exist_ok=True) + instance.symlink( + context_xml, + instance.context_xml, + exist_ok=True) # Link /etc/pki//logging.properties # to /usr/share/pki/server/conf/logging.properties. @@ -176,7 +179,10 @@ def spawn(self, deployer): # Link /etc/pki//web.xml # to /usr/share/tomcat/conf/web.xml. web_xml = os.path.join(pki.server.Tomcat.CONF_DIR, 'web.xml') - instance.symlink(web_xml, instance.web_xml, exist_ok=True) + instance.symlink( + web_xml, + instance.web_xml, + exist_ok=True) # Create /etc/pki//Catalina catalina_dir = os.path.join(instance.conf_dir, 'Catalina') @@ -233,15 +239,17 @@ def spawn(self, deployer): deployer.directory.create(instance.work_dir) # Link /var/lib/pki//bin to /usr/share/tomcat/bin - deployer.symlink.create( + instance.symlink( deployer.mdict['pki_tomcat_bin_path'], - instance.bin_dir) + instance.bin_dir, + exist_ok=True) # Link /var/lib/pki//conf to /etc/pki/ conf_link = os.path.join(instance.base_dir, 'conf') - deployer.symlink.create( + instance.symlink( instance.conf_dir, - conf_link) + conf_link, + exist_ok=True) # Create /etc/pki//certs certs_path = os.path.join(instance.conf_dir, 'certs') @@ -249,9 +257,10 @@ def spawn(self, deployer): # Link /var/lib/pki//logs to /var/log/pki/ logs_link = os.path.join(instance.base_dir, 'logs') - deployer.symlink.create( + instance.symlink( instance.log_dir, - logs_link) + logs_link, + exist_ok=True) if config.str2bool(deployer.mdict['pki_registry_enable']): instance.create_registry() @@ -277,9 +286,10 @@ def spawn(self, deployer): pki.server.instance.PKIInstance.TARGET_WANTS, instance.service_name + '.service') - deployer.symlink.create( + instance.symlink( pki.server.instance.PKIInstance.UNIT_FILE, - systemd_service_link) + systemd_service_link, + exist_ok=True) def destroy(self, deployer):