diff options
author | Endi S. Dewata <edewata@redhat.com> | 2015-05-14 00:42:07 -0400 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2015-05-14 11:12:43 -0400 |
commit | 5e3c922b43e622b6687917bdc3c174b7a4c2f001 (patch) | |
tree | f8890c6ddac2c18941b4f7f846c32b7d3a8e7ec2 /base/server/python | |
parent | 8e350c3d765ab0ac1922dd814952fca9ff3f1e02 (diff) | |
download | pki-5e3c922b43e622b6687917bdc3c174b7a4c2f001.tar.gz pki-5e3c922b43e622b6687917bdc3c174b7a4c2f001.tar.xz pki-5e3c922b43e622b6687917bdc3c174b7a4c2f001.zip |
Fixed problem redeploying subsystem.
The pki-server subsystem-enable CLI has been modified to deploy
the subsystem from a custom location if available, or from the
default location otherwise.
https://fedorahosted.org/pki/ticket/1381
Diffstat (limited to 'base/server/python')
-rw-r--r-- | base/server/python/pki/server/__init__.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/base/server/python/pki/server/__init__.py b/base/server/python/pki/server/__init__.py index bc53598d4..9777d221f 100644 --- a/base/server/python/pki/server/__init__.py +++ b/base/server/python/pki/server/__init__.py @@ -61,10 +61,10 @@ class PKISubsystem(object): if self.type >= 10: self.base_dir = os.path.join(self.instance.base_dir, self.name) - self.conf_dir = os.path.join(self.base_dir, 'conf') else: self.base_dir = instance.base_dir - self.conf_dir = os.path.join(self.base_dir, 'conf') + + self.conf_dir = os.path.join(self.base_dir, 'conf') self.context_xml_template = os.path.join( pki.SHARE_DIR, self.name, 'conf', 'Catalina', 'localhost', self.name + '.xml') @@ -72,6 +72,7 @@ class PKISubsystem(object): self.context_xml = os.path.join( instance.conf_dir, 'Catalina', 'localhost', self.name + '.xml') + # custom subsystem location self.doc_base = os.path.join(self.base_dir, 'webapps', self.name) def is_valid(self): @@ -87,7 +88,16 @@ class PKISubsystem(object): return self.instance.is_deployed(self.name) def enable(self): - self.instance.deploy(self.name, self.context_xml_template, self.doc_base) + if os.path.exists(self.doc_base): + # deploy custom subsystem if exists + doc_base = self.doc_base + + else: + # otherwise deploy default subsystem directly from + # /usr/share/pki/<subsystem>/webapps/<subsystem> + doc_base = None + + self.instance.deploy(self.name, self.context_xml_template, doc_base) def disable(self): self.instance.undeploy(self.name) |