Skip to content

Commit

Permalink
Update PKIServer.remove()
Browse files Browse the repository at this point in the history
The PKIServer.remove() has been updated to remove the
/var/lib/pki/<instance>/alias symlink if it exists.
  • Loading branch information
edewata committed Sep 19, 2024
1 parent 69c899c commit d07d0c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/acme-separate-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,6 @@ jobs:
# TODO: review permissions
cat > expected << EOF
lrwxrwxrwx pkiuser pkiuser alias -> /var/lib/pki/pki-tomcat/conf/alias
lrwxrwxrwx pkiuser pkiuser conf -> /etc/pki/pki-tomcat
lrwxrwxrwx pkiuser pkiuser logs -> /var/log/pki/pki-tomcat
EOF
Expand Down
5 changes: 5 additions & 0 deletions base/server/python/pki/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,11 @@ def remove(self, remove_conf=False, remove_logs=False, force=False):
logger.info('Removing %s', self.bin_dir)
pki.util.unlink(self.bin_dir, force=force)

# remove /var/lib/pki/<instance>/alias if exists
if os.path.islink(self.nssdb_link):
logger.info('Removing %s', self.nssdb_link)
pki.util.unlink(self.nssdb_link)

if os.path.isdir(self.base_dir) and not os.listdir(self.base_dir):

# Remove instance base dir if empty
Expand Down

0 comments on commit d07d0c7

Please sign in to comment.