summaryrefslogtreecommitdiffstats
path: root/base/server/python/pki/server/__init__.py
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2015-05-06 00:08:30 -0400
committerEndi S. Dewata <edewata@redhat.com>2015-05-06 17:25:10 -0400
commit243cbf17ef88a3ec00980670f3918db925955c6c (patch)
tree67d33eac0528fce60f48c1cab618c94e8ae2d14b /base/server/python/pki/server/__init__.py
parent2aa7ed131f4d229269088775513f23ec8b3793ec (diff)
downloadpki-243cbf17ef88a3ec00980670f3918db925955c6c.tar.gz
pki-243cbf17ef88a3ec00980670f3918db925955c6c.tar.xz
pki-243cbf17ef88a3ec00980670f3918db925955c6c.zip
Fixed migration tool to update Tomcat libraries.
The migration tool has been fixed to update the links to Tomcat libraries in the instance folder to match the current Tomcat version installed on the system. https://fedorahosted.org/pki/ticket/1353
Diffstat (limited to 'base/server/python/pki/server/__init__.py')
-rw-r--r--base/server/python/pki/server/__init__.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/base/server/python/pki/server/__init__.py b/base/server/python/pki/server/__init__.py
index bbdfedc2c..7cb50fcee 100644
--- a/base/server/python/pki/server/__init__.py
+++ b/base/server/python/pki/server/__init__.py
@@ -50,6 +50,7 @@ class PKIServer(object):
return instances
+
class PKISubsystem(object):
def __init__(self, instance, subsystem_name):
@@ -104,10 +105,11 @@ class PKIInstance(object):
if self.type >= 10:
self.base_dir = os.path.join(INSTANCE_BASE_DIR, name)
- self.conf_dir = os.path.join(self.base_dir, 'conf')
else:
self.base_dir = os.path.join(pki.BASE_DIR, name)
- self.conf_dir = os.path.join(self.base_dir, 'conf')
+
+ self.conf_dir = os.path.join(self.base_dir, 'conf')
+ self.lib_dir = os.path.join(self.base_dir, 'lib')
self.registry_dir = os.path.join(pki.server.REGISTRY_DIR, 'tomcat', self.name)
self.registry_file = os.path.join(self.registry_dir, self.name)
@@ -146,10 +148,12 @@ class PKIInstance(object):
m = re.search('^PKI_USER=(.*)$', line)
if m:
self.user = m.group(1)
+ self.uid = pwd.getpwnam(self.user).pw_uid
m = re.search('^PKI_GROUP=(.*)$', line)
if m:
self.group = m.group(1)
+ self.gid = grp.getgrnam(self.group).gr_gid
for subsystem_name in os.listdir(self.registry_dir):
if subsystem_name in pki.server.SUBSYSTEM_TYPES:
@@ -196,12 +200,8 @@ class PKIInstance(object):
with open(context_xml, 'w') as f:
f.write(etree.tostring(document, pretty_print=True))
- # find uid and gid
- uid = pwd.getpwnam(self.user).pw_uid
- gid = grp.getgrnam(self.group).gr_gid
-
# set deployment descriptor ownership and permission
- os.chown(context_xml, uid, gid)
+ os.chown(context_xml, self.uid, self.gid)
os.chmod(context_xml, 00660)
def undeploy(self, webapp_name):