Skip to content

Commit

Permalink
Replace PKIDeployer.symlink.create() with PKIServer.symlink()
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Nov 16, 2023
1 parent ae6e19e commit efca54c
Showing 1 changed file with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ def spawn(self, deployer):
# Link /etc/pki/<instance>/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/<instance>/logging.properties
# to /usr/share/pki/server/conf/logging.properties.
Expand Down Expand Up @@ -176,7 +179,10 @@ def spawn(self, deployer):
# Link /etc/pki/<instance>/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/<instance>/Catalina
catalina_dir = os.path.join(instance.conf_dir, 'Catalina')
Expand Down Expand Up @@ -233,25 +239,28 @@ def spawn(self, deployer):
deployer.directory.create(instance.work_dir)

# Link /var/lib/pki/<instance>/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/<instance>/conf to /etc/pki/<instance>
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/<instance>/certs
certs_path = os.path.join(instance.conf_dir, 'certs')
deployer.directory.create(certs_path)

# Link /var/lib/pki/<instance>/logs to /var/log/pki/<instance>
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()
Expand All @@ -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):

Expand Down

0 comments on commit efca54c

Please sign in to comment.