From d07d0c7b37ed967c21218170768dbb564465e9fa Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Thu, 12 Sep 2024 11:04:21 -0500 Subject: [PATCH] Update PKIServer.remove() The PKIServer.remove() has been updated to remove the /var/lib/pki//alias symlink if it exists. --- .github/workflows/acme-separate-test.yml | 1 - base/server/python/pki/server/__init__.py | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/acme-separate-test.yml b/.github/workflows/acme-separate-test.yml index 3ab9c8b54ad..227f0084416 100644 --- a/.github/workflows/acme-separate-test.yml +++ b/.github/workflows/acme-separate-test.yml @@ -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 diff --git a/base/server/python/pki/server/__init__.py b/base/server/python/pki/server/__init__.py index fcbef1fe2a0..fbc8f6159c4 100644 --- a/base/server/python/pki/server/__init__.py +++ b/base/server/python/pki/server/__init__.py @@ -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//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