>From c23f1ac216469ba9e1e597bf8697847a190da39a Mon Sep 17 00:00:00 2001
From: Abhishek Koneru <akoneru@redhat.com>
Date: Thu, 30 May 2013 14:52:51 -0400
Subject: [PATCH] Code cleanup and fixing Pylint errors.

All the classes in pkihelper.py have functions rather than methods.
Currently an instance of all the classes is created when importing
the pkihelper module to access the methods, which is not required
and is also not a good practice. Since all the methods are just
utility functions and do not modify the state, it is sufficient to
mark them as static methods '@staticmethod' and access them by
calling className.<function name>.

Ticket #316 - Part 1
---
 .pydevproject                                      |   11 +-
 base/server/src/engine/pkihelper.py                |  484 +++++++++++---------
 base/server/src/scriptlets/configuration.py        |   57 ++-
 base/server/src/scriptlets/finalization.py         |   28 +-
 .../server/src/scriptlets/infrastructure_layout.py |   32 +-
 base/server/src/scriptlets/initialization.py       |   42 +-
 base/server/src/scriptlets/instance_layout.py      |  122 ++---
 base/server/src/scriptlets/security_databases.py   |   46 +-
 base/server/src/scriptlets/selinux_setup.py        |   10 +-
 base/server/src/scriptlets/slot_substitution.py    |   24 +-
 base/server/src/scriptlets/subsystem_layout.py     |   62 +--
 base/server/src/scriptlets/webapp_deployment.py    |   46 +-
 12 files changed, 520 insertions(+), 444 deletions(-)

diff --git a/.pydevproject b/.pydevproject
index a9cca037b33037ebc3232e6b63f3f00283463a4e..f7446f368246abb4080b171ea817b5563c581d02 100644
--- a/.pydevproject
+++ b/.pydevproject
@@ -1,7 +1,12 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?eclipse-pydev version="1.0"?>
-
-<pydev_project>
+<?eclipse-pydev version="1.0"?><pydev_project>
 <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
 <pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
+<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
+<path>/DogTagCode/base/common/python/pki</path>
+<path>/DogTagCode/base/server/src</path>
+<path>/DogTagCode/base/server/python/pki/server</path>
+<path>/DogTagCode/base/server/src/engine</path>
+<path>/DogTagCode/base/server/src/scriptlets</path>
+</pydev_pathproperty>
 </pydev_project>
diff --git a/base/server/src/engine/pkihelper.py b/base/server/src/engine/pkihelper.py
index df36583079cea16a0d199de3e0007bc7a1a12e12..5c43e9d91fad1d5f316cf97e5f8e7cb1f398c4fe 100644
--- a/base/server/src/engine/pkihelper.py
+++ b/base/server/src/engine/pkihelper.py
@@ -129,9 +129,11 @@ def pki_copytree(src, dst, symlinks = False, ignore = None):
     if errors:
         raise Error, errors
 
-# PKI Deployment Identity Class
-class identity:
-    def __add_gid(self, pki_group):
+class Identity:
+    "PKI Deployment Identity Class"
+    @staticmethod
+    def __add_gid(pki_group):
+        "Adding a group id"
         pki_gid = None
         try:
             # Does the specified 'pki_group' exist?
@@ -181,7 +183,9 @@ class identity:
             raise
         return
 
-    def __add_uid(self, pki_user, pki_group):
+    @staticmethod
+    def __add_uid(pki_user, pki_group):
+        "Add the User Id"
         pki_uid = None
         try:
             # Does the specified 'pki_user' exist?
@@ -255,13 +259,17 @@ class identity:
                                  extra = config.PKI_INDENTATION_LEVEL_2)
             raise
         return
-
-    def add_uid_and_gid(self, pki_user, pki_group):
-        self.__add_gid(pki_group)
-        self.__add_uid(pki_user, pki_group)
+    
+    @staticmethod
+    def add_uid_and_gid(pki_user, pki_group):
+        "Add both User ID and Group ID"
+        Identity.__add_gid(pki_group)
+        Identity.__add_uid(pki_user, pki_group)
         return
 
-    def get_uid(self, critical_failure = True):
+    @staticmethod
+    def get_uid(critical_failure = True):
+        "Fetch the user id."
         try:
             pki_uid = master['pki_uid']
         except KeyError as exc:
@@ -271,7 +279,9 @@ class identity:
                 raise
         return pki_uid
 
-    def get_gid(self, critical_failure = True):
+    @staticmethod
+    def get_gid(critical_failure = True):
+        "Fetch the group id."
         try:
             pki_gid = master['pki_gid']
         except KeyError as exc:
@@ -281,7 +291,9 @@ class identity:
                 raise
         return pki_gid
 
-    def set_uid(self, name, critical_failure = True):
+    @staticmethod
+    def set_uid(name, critical_failure = True):
+        "Modify the user id."
         try:
             config.pki_log.debug(log.PKIHELPER_USER_1, name,
                                  extra = config.PKI_INDENTATION_LEVEL_2)
@@ -297,7 +309,9 @@ class identity:
                 raise
         return pki_uid
 
-    def set_gid(self, name, critical_failure = True):
+    @staticmethod
+    def set_gid(name, critical_failure = True):
+        "Modify the group id."
         try:
             config.pki_log.debug(log.PKIHELPER_GROUP_1, name,
                                  extra = config.PKI_INDENTATION_LEVEL_2)
@@ -314,11 +328,13 @@ class identity:
         return pki_gid
 
 
-# PKI Deployment Namespace Class
-class namespace:
-    # Silently verify that the selected 'pki_instance_name' will
-    # NOT produce any namespace collisions
-    def collision_detection(self):
+class Namespace:
+    "PKI Deployment Namespace Class"
+
+    @staticmethod
+    def collision_detection():
+        "Verify that the selected 'pki_instance_name' will not produce"\
+        " any namespace collisions"
         # Run simple checks for pre-existing namespace collisions
         if os.path.exists(master['pki_instance_path']):
             if os.path.exists(master['pki_subsystem_path']):
@@ -433,8 +449,11 @@ class namespace:
 
 
 # PKI Deployment Configuration File Class
-class configuration_file:
-    def log_configuration_url(self):
+class Configuration_file:
+    """PKI Deployment Configuration File Class"""
+    
+    @staticmethod
+    def log_configuration_url():
         # NOTE:  This is the one and only parameter containing a sensitive
         #        parameter that may be stored in a log file.
         config.pki_log.info(log.PKI_CONFIGURATION_WIZARD_URL_1,
@@ -444,7 +463,8 @@ class configuration_file:
                             master['pki_registry_initscript_command'],
                             extra = config.PKI_INDENTATION_LEVEL_2)
 
-    def display_configuration_url(self):
+    @staticmethod
+    def display_configuration_url():
         # NOTE:  This is the one and only parameter containing a sensitive
         #        parameter that may be displayed to the screen.
         print log.PKI_CONFIGURATION_URL_1 % master['pki_configuration_url']
@@ -453,7 +473,8 @@ class configuration_file:
               master['pki_registry_initscript_command']
         print
 
-    def verify_sensitive_data(self):
+    @staticmethod
+    def verify_sensitive_data():
         # Silently verify the existence of 'sensitive' data
         if master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS:
             # Verify existence of Directory Server Password (ALWAYS)
@@ -546,7 +567,8 @@ class configuration_file:
                                                                                          master['pki_user_deployment_cfg']))
         return
 
-    def verify_mutually_exclusive_data(self):
+    @staticmethod
+    def verify_mutually_exclusive_data():
         # Silently verify the existence of 'mutually exclusive' data
         if master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS:
             if master['pki_subsystem'] == "CA":
@@ -580,7 +602,8 @@ class configuration_file:
                         extra = config.PKI_INDENTATION_LEVEL_2)
                     raise Exception(log.PKIHELPER_MUTUALLY_EXCLUSIVE_EXTERNAL_SUB_CA % master['pki_user_deployment_cfg'])
 
-    def verify_predefined_configuration_file_data(self):
+    @staticmethod
+    def verify_predefined_configuration_file_data():
         # Silently verify the existence of any required 'predefined' data
         #
         # FUTURE:  As much as is possible, alter this routine to verify
@@ -781,7 +804,8 @@ class configuration_file:
                         raise Exception(log.PKIHELPER_UNDEFINED_CONFIGURATION_FILE_ENTRY_2 % "pki_extrenal_ca_cert_path")
         return
 
-    def populate_non_default_ports(self):
+    @staticmethod
+    def populate_non_default_ports():
         if master['pki_http_port'] != \
             str(config.PKI_DEPLOYMENT_DEFAULT_TOMCAT_HTTP_PORT):
                 ports.append(master['pki_http_port'])
@@ -796,7 +820,8 @@ class configuration_file:
                 ports.append(master['pki_ajp_port'])
         return
 
-    def verify_selinux_ports(self):
+    @staticmethod
+    def verify_selinux_ports():
         # Determine which ports still need to be labelled, and if any are
         # incorrectly labelled
         if len(ports) == 0:
@@ -816,7 +841,7 @@ class configuration_file:
                 if portrecs[i][0] == "unreserved_port_t" or \
                    portrecs[i][0] == "reserved_port_t" or \
                    i[2] != "tcp":
-                       continue
+                    continue
                 if i[0] <= int(port) and int(port) <= i[1]:
                     context = portrecs[i][0]
                     break
@@ -836,7 +861,8 @@ class configuration_file:
                 raise Exception(log.PKIHELPER_INVALID_SELINUX_CONTEXT_FOR_PORT % (port, context))
         return
 
-    def verify_command_matches_configuration_file(self):
+    @staticmethod
+    def verify_command_matches_configuration_file():
         # Silently verify that the command-line parameters match the values
         # that are present in the corresponding configuration file
         if master['pki_deployment_executable'] == 'pkidestroy':
@@ -887,8 +913,11 @@ class configuration_file:
 
 
 # PKI Deployment Instance Class
-class instance:
-    def apache_instance_subsystems(self):
+class Instance:
+    """ PKI Deployment Instance Class """
+    
+    @staticmethod
+    def apache_instance_subsystems():
         rv = 0
         try:
             # count number of PKI subsystems present
@@ -905,8 +934,9 @@ class instance:
                                  extra = config.PKI_INDENTATION_LEVEL_2)
             raise
         return rv
-
-    def apache_instances(self):
+    
+    @staticmethod
+    def apache_instances():
         rv = 0
         try:
             # Since ALL directories under the top-level PKI 'apache' registry
@@ -933,7 +963,8 @@ class instance:
             raise
         return rv
 
-    def pki_instance_subsystems(self):
+    @staticmethod
+    def pki_instance_subsystems():
         rv = 0
         try:
             # Since ALL directories within the top-level PKI infrastructure
@@ -961,7 +992,8 @@ class instance:
             raise
         return rv
 
-    def tomcat_instance_subsystems(self):
+    @staticmethod
+    def tomcat_instance_subsystems():
         # Return list of PKI subsystems in the specified tomcat instance
         rv = []
         try:
@@ -974,8 +1006,9 @@ class instance:
                                  extra = config.PKI_INDENTATION_LEVEL_2)
             raise
         return rv
-
-    def tomcat_instances(self):
+ 
+    @staticmethod
+    def tomcat_instances():
         rv = 0
         try:
             # Since ALL directories under the top-level PKI 'tomcat' registry
@@ -1002,7 +1035,8 @@ class instance:
             raise
         return rv
 
-    def verify_subsystem_exists(self):
+    @staticmethod
+    def verify_subsystem_exists():
         try:
             if not os.path.exists(master['pki_subsystem_path']):
                 config.pki_log.error(log.PKI_SUBSYSTEM_DOES_NOT_EXIST_2,
@@ -1016,7 +1050,8 @@ class instance:
                                  extra = config.PKI_INDENTATION_LEVEL_2)
             raise
 
-    def verify_subsystem_does_not_exist(self):
+    @staticmethod
+    def verify_subsystem_does_not_exist():
         try:
             if os.path.exists(master['pki_subsystem_path']):
                 config.pki_log.error(log.PKI_SUBSYSTEM_ALREADY_EXISTS_2,
@@ -1030,8 +1065,9 @@ class instance:
                                  extra = config.PKI_INDENTATION_LEVEL_2)
             raise
 
-    def get_instance_status(self):
-        self.connection = pki.client.PKIConnection(
+    @staticmethod
+    def get_instance_status():
+        connection = pki.client.PKIConnection(
             protocol = 'https',
             hostname = master['pki_hostname'],
             port = master['pki_https_port'],
@@ -1039,7 +1075,7 @@ class instance:
             accept = 'application/xml')
 
         try:
-            client = pki.system.SystemStatusClient(self.connection)
+            client = pki.system.SystemStatusClient(connection)
             response = client.getStatus()
             config.pki_log.debug(response,
                 extra = config.PKI_INDENTATION_LEVEL_3)
@@ -1052,20 +1088,23 @@ class instance:
                 extra = config.PKI_INDENTATION_LEVEL_3)
             return None
 
-    def wait_for_startup(self, timeout):
+    @staticmethod
+    def wait_for_startup(timeout):
         start_time = datetime.today()
         status = None
         while status != "running":
-            status = self.get_instance_status()
+            status = Instance.get_instance_status()
             time.sleep(1);
             stop_time = datetime.today()
             if (stop_time - start_time).total_seconds() >= timeout:
                 break
         return status
 
-# PKI Deployment Directory Class
-class directory:
-    def create(self, name, uid = None, gid = None,
+class Directory:
+    """PKI Deployment Directory Class"""
+
+    @staticmethod    
+    def create(name, uid = None, gid = None,
                perms = config.PKI_DEPLOYMENT_DEFAULT_DIR_PERMISSIONS,
                acls = None, critical_failure = True):
         try:
@@ -1080,9 +1119,9 @@ class directory:
                 os.chmod(name, perms)
                 # chown <uid>:<gid> <name>
                 if uid == None:
-                    uid = identity.get_uid()
+                    uid = Identity.get_uid()
                 if gid == None:
-                    gid = identity.get_gid()
+                    gid = Identity.get_gid()
                 config.pki_log.debug(log.PKIHELPER_CHOWN_3,
                                      uid, gid, name,
                                      extra = config.PKI_INDENTATION_LEVEL_3)
@@ -1114,7 +1153,8 @@ class directory:
                     raise
         return
 
-    def modify(self, name, uid = None, gid = None,
+    @staticmethod
+    def modify(name, uid = None, gid = None,
                perms = config.PKI_DEPLOYMENT_DEFAULT_DIR_PERMISSIONS,
                acls = None, silent = False, critical_failure = True):
         try:
@@ -1136,9 +1176,9 @@ class directory:
                 os.chmod(name, perms)
                 # chown <uid>:<gid> <name>
                 if uid == None:
-                    uid = identity.get_uid()
+                    uid = Identity.get_uid()
                 if gid == None:
-                    gid = identity.get_gid()
+                    gid = Identity.get_gid()
                 if not silent:
                     config.pki_log.debug(log.PKIHELPER_CHOWN_3,
                                          uid, gid, name,
@@ -1161,7 +1201,7 @@ class directory:
                     log.PKI_DIRECTORY_MISSING_OR_NOT_A_DIRECTORY_1, name,
                     extra = config.PKI_INDENTATION_LEVEL_2)
                 if critical_failure == True:
-                    raise Exception(log.PKI_DIRECTORY_NISSING_OR_NOT_A_DIRECTORY_1 % name)
+                    raise Exception(log.PKI_DIRECTORY_MISSING_OR_NOT_A_DIRECTORY_1 % name)
         except OSError as exc:
             config.pki_log.error(log.PKI_OSERROR_1, exc,
                                  extra = config.PKI_INDENTATION_LEVEL_2)
@@ -1169,7 +1209,8 @@ class directory:
                 raise
         return
 
-    def delete(self, name, recursive_flag = True, critical_failure = True):
+    @staticmethod
+    def delete(name, recursive_flag = True, critical_failure = True):
         try:
             if not os.path.exists(name) or not os.path.isdir(name):
                 # Simply issue a warning and continue
@@ -1194,7 +1235,8 @@ class directory:
                 raise
         return
 
-    def exists(self, name):
+    @staticmethod
+    def exists(name):
         try:
             if not os.path.exists(name) or not os.path.isdir(name):
                 return False
@@ -1204,8 +1246,8 @@ class directory:
             config.pki_log.error(log.PKI_OSERROR_1, exc,
                                  extra = config.PKI_INDENTATION_LEVEL_2)
             raise
-
-    def is_empty(self, name):
+    @staticmethod
+    def is_empty(name):
         try:
             if not os.listdir(name):
                 config.pki_log.debug(log.PKIHELPER_DIRECTORY_IS_EMPTY_1,
@@ -1219,8 +1261,8 @@ class directory:
             config.pki_log.error(log.PKI_OSERROR_1, exc,
                                  extra = config.PKI_INDENTATION_LEVEL_2)
             raise
-
-    def set_mode(self, name, uid = None, gid = None,
+    @staticmethod
+    def set_mode(name, uid = None, gid = None,
                  dir_perms = config.PKI_DEPLOYMENT_DEFAULT_DIR_PERMISSIONS,
                  file_perms = config.PKI_DEPLOYMENT_DEFAULT_FILE_PERMISSIONS,
                  symlink_perms = \
@@ -1238,9 +1280,9 @@ class directory:
                     log.PKIHELPER_SET_MODE_1, name,
                     extra = config.PKI_INDENTATION_LEVEL_2)
                 if uid == None:
-                    uid = identity.get_uid()
+                    uid = Identity.get_uid()
                 if gid == None:
-                    gid = identity.get_gid()
+                    gid = Identity.get_gid()
                 if recursive_flag == True:
                     for root, dirs, files in os.walk(name):
                         for name in files:
@@ -1355,7 +1397,8 @@ class directory:
             if critical_failure == True:
                 raise
 
-    def copy(self, old_name, new_name, uid = None, gid = None,
+    @staticmethod
+    def copy(old_name, new_name, uid = None, gid = None,
              dir_perms = config.PKI_DEPLOYMENT_DEFAULT_DIR_PERMISSIONS,
              file_perms = config.PKI_DEPLOYMENT_DEFAULT_FILE_PERMISSIONS,
              symlink_perms = config.PKI_DEPLOYMENT_DEFAULT_SYMLINK_PERMISSIONS,
@@ -1395,11 +1438,11 @@ class directory:
                     shutil.copy2(old_name, new_name)
                 # set ownerships, permissions, and acls
                 # of newly created top-level directory
-                self.modify(new_name, uid, gid, dir_perms, dir_acls,
+                Directory.modify(new_name, uid, gid, dir_perms, dir_acls,
                             True, critical_failure)
                 # set ownerships, permissions, and acls
                 # of contents of newly created top-level directory
-                self.set_mode(new_name, uid, gid,
+                Directory.set_mode(new_name, uid, gid,
                               dir_perms, file_perms, symlink_perms,
                               dir_acls, file_acls, symlink_acls,
                               recursive_flag, critical_failure)
@@ -1416,9 +1459,10 @@ class directory:
         return
 
 
-# PKI Deployment File Class (also used for executables)
-class file:
-    def create(self, name, uid = None, gid = None,
+class File:
+    """PKI Deployment File Class (also used for executables)"""
+    @staticmethod
+    def create(name, uid = None, gid = None,
                perms = config.PKI_DEPLOYMENT_DEFAULT_FILE_PERMISSIONS,
                acls = None, critical_failure = True):
         try:
@@ -1433,9 +1477,9 @@ class file:
                 os.chmod(name, perms)
                 # chown <uid>:<gid> <name>
                 if uid == None:
-                    uid = identity.get_uid()
+                    uid = Identity.get_uid()
                 if gid == None:
-                    gid = identity.get_gid()
+                    gid = Identity.get_gid()
                 config.pki_log.debug(log.PKIHELPER_CHOWN_3,
                                      uid, gid, name,
                                      extra = config.PKI_INDENTATION_LEVEL_3)
@@ -1467,7 +1511,8 @@ class file:
                     raise
         return
 
-    def modify(self, name, uid = None, gid = None,
+    @staticmethod
+    def modify(name, uid = None, gid = None,
                perms = config.PKI_DEPLOYMENT_DEFAULT_FILE_PERMISSIONS,
                acls = None, silent = False, critical_failure = True):
         try:
@@ -1489,9 +1534,9 @@ class file:
                 os.chmod(name, perms)
                 # chown <uid>:<gid> <name>
                 if uid == None:
-                    uid = identity.get_uid()
+                    uid = Identity.get_uid()
                 if gid == None:
-                    gid = identity.get_gid()
+                    gid = Identity.get_gid()
                 if not silent:
                     config.pki_log.debug(log.PKIHELPER_CHOWN_3,
                                          uid, gid, name,
@@ -1522,7 +1567,8 @@ class file:
                 raise
         return
 
-    def delete(self, name, critical_failure = True):
+    @staticmethod
+    def delete(name, critical_failure = True):
         try:
             if not os.path.exists(name) or not os.path.isfile(name):
                 # Simply issue a warning and continue
@@ -1541,7 +1587,8 @@ class file:
                 raise
         return
 
-    def exists(self, name):
+    @staticmethod
+    def exists(name):
         try:
             if not os.path.exists(name) or not os.path.isfile(name):
                 return False
@@ -1552,7 +1599,8 @@ class file:
                                  extra = config.PKI_INDENTATION_LEVEL_2)
             raise
 
-    def copy(self, old_name, new_name, uid = None, gid = None,
+    @staticmethod
+    def copy(old_name, new_name, uid = None, gid = None,
              perms = config.PKI_DEPLOYMENT_DEFAULT_FILE_PERMISSIONS, acls = None,
              overwrite_flag = False, critical_failure = True):
         try:
@@ -1574,9 +1622,9 @@ class file:
                                     extra = config.PKI_INDENTATION_LEVEL_2)
                 shutil.copy2(old_name, new_name)
                 if uid == None:
-                    uid = identity.get_uid()
+                    uid = Identity.get_uid()
                 if gid == None:
-                    gid = identity.get_gid()
+                    gid = Identity.get_gid()
                 # chmod <perms> <new_name>
                 config.pki_log.debug(log.PKIHELPER_CHMOD_2,
                                      perms, new_name,
@@ -1610,8 +1658,9 @@ class file:
                 raise
         return
 
+    @staticmethod
     def apply_slot_substitution(
-                         self, name, uid = None, gid = None,
+                         name, uid = None, gid = None,
                          perms = config.PKI_DEPLOYMENT_DEFAULT_FILE_PERMISSIONS,
                          acls = None, critical_failure = True):
         try:
@@ -1634,9 +1683,9 @@ class file:
                         line = line.replace(slots[slot], master[slot])
                 sys.stdout.write(line)
             if uid == None:
-                uid = identity.get_uid()
+                uid = Identity.get_uid()
             if gid == None:
-                gid = identity.get_gid()
+                gid = Identity.get_gid()
             # chmod <perms> <name>
             config.pki_log.debug(log.PKIHELPER_CHMOD_2,
                                  perms, name,
@@ -1670,8 +1719,9 @@ class file:
                 raise
         return
 
+    @staticmethod
     def copy_with_slot_substitution(
-                         self, old_name, new_name, uid = None, gid = None,
+                         old_name, new_name, uid = None, gid = None,
                          perms = config.PKI_DEPLOYMENT_DEFAULT_FILE_PERMISSIONS,
                          acls = None, overwrite_flag = False,
                          critical_failure = True):
@@ -1704,9 +1754,9 @@ class file:
                     FILE.write(line)
                 FILE.close()
                 if uid == None:
-                    uid = identity.get_uid()
+                    uid = Identity.get_uid()
                 if gid == None:
-                    gid = identity.get_gid()
+                    gid = Identity.get_gid()
                 # chmod <perms> <new_name>
                 config.pki_log.debug(log.PKIHELPER_CHMOD_2,
                                      perms, new_name,
@@ -1740,7 +1790,8 @@ class file:
                 raise
         return
 
-    def generate_noise_file(self, name, bytes, uid = None, gid = None,
+    @staticmethod
+    def generate_noise_file(name, bytes, uid = None, gid = None,
             perms = config.PKI_DEPLOYMENT_DEFAULT_FILE_PERMISSIONS,
             acls = None, critical_failure = True):
         try:
@@ -1761,9 +1812,9 @@ class file:
                 os.chmod(name, perms)
                 # chown <uid>:<gid> <name>
                 if uid == None:
-                    uid = identity.get_uid()
+                    uid = Identity.get_uid()
                 if gid == None:
-                    gid = identity.get_gid()
+                    gid = Identity.get_gid()
                 config.pki_log.debug(log.PKIHELPER_CHOWN_3,
                                      uid, gid, name,
                                      extra = config.PKI_INDENTATION_LEVEL_3)
@@ -1784,7 +1835,7 @@ class file:
                     log.PKI_FILE_ALREADY_EXISTS_NOT_A_FILE_1, name,
                     extra = config.PKI_INDENTATION_LEVEL_2)
                 if critical_failure == True:
-                    raise Exception(log.PKI_FILE_ALREADY_EXISTS_MOT_A_FILE_1 % name)
+                    raise Exception(log.PKI_FILE_ALREADY_EXISTS_NOT_A_FILE_1 % name)
         except OSError as exc:
             if exc.errno == errno.EEXIST:
                 pass
@@ -1796,9 +1847,11 @@ class file:
         return
 
 
-# PKI Deployment Symbolic Link Class
-class symlink:
-    def create(self, name, link, uid = None, gid = None,
+class Symlink:
+    """PKI Deployment Symbolic Link Class"""
+    
+    @staticmethod
+    def create(name, link, uid = None, gid = None,
                acls = None, allow_dangling_symlink = False, critical_failure = True):
         try:
             if not os.path.exists(link):
@@ -1817,9 +1870,9 @@ class symlink:
                 #            CANNOT be run directly against symbolic links!
                 # chown -h <uid>:<gid> <link>
                 if uid == None:
-                    uid = identity.get_uid()
+                    uid = Identity.get_uid()
                 if gid == None:
-                    gid = identity.get_gid()
+                    gid = Identity.get_gid()
                 config.pki_log.debug(log.PKIHELPER_CHOWN_H_3,
                                      uid, gid, link,
                                      extra = config.PKI_INDENTATION_LEVEL_3)
@@ -1851,8 +1904,9 @@ class symlink:
                 if critical_failure == True:
                     raise
         return
-
-    def modify(self, link, uid = None, gid = None,
+ 
+    @staticmethod
+    def modify(link, uid = None, gid = None,
                acls = None, silent = False, critical_failure = True):
         try:
             if os.path.exists(link):
@@ -1871,9 +1925,9 @@ class symlink:
                 #            CANNOT be run directly against symbolic links!
                 # chown -h <uid>:<gid> <link>
                 if uid == None:
-                    uid = identity.get_uid()
+                    uid = Identity.get_uid()
                 if gid == None:
-                    gid = identity.get_gid()
+                    gid = Identity.get_gid()
                 if not silent:
                     config.pki_log.debug(log.PKIHELPER_CHOWN_H_3,
                                          uid, gid, link,
@@ -1905,7 +1959,8 @@ class symlink:
                 raise
         return
 
-    def delete(self, link, critical_failure = True):
+    @staticmethod
+    def delete(link, critical_failure = True):
         try:
             if not os.path.exists(link) or not os.path.islink(link):
                 # Simply issue a warning and continue
@@ -1924,7 +1979,8 @@ class symlink:
                 raise
         return
 
-    def exists(self, name):
+    @staticmethod
+    def exists(name):
         try:
             if not os.path.exists(name) or not os.path.islink(name):
                 return False
@@ -1935,9 +1991,11 @@ class symlink:
                                  extra = config.PKI_INDENTATION_LEVEL_2)
             raise
 
-# PKI Deployment War File Class
-class war:
-    def explode(self, name, path, critical_failure = True):
+class War:
+    """PKI Deployment War File Class"""
+    
+    @staticmethod
+    def explode(name, path, critical_failure = True):
         try:
             if os.path.exists(name) and os.path.isfile(name):
                 if not zipfile.is_zipfile(name):
@@ -1983,9 +2041,11 @@ class war:
         return
 
 
-# PKI Deployment Password Class
-class password:
-    def create_password_conf(self, path, pin, pin_sans_token = False,
+class Password:
+    """PKI Deployment Password Class"""
+
+    @staticmethod
+    def create_password_conf(path, pin, pin_sans_token = False,
                              overwrite_flag = False, critical_failure = True):
         try:
             if os.path.exists(path):
@@ -2004,7 +2064,6 @@ class password:
                         else:
                             fd.write(master['pki_self_signed_token'] + \
                                      "=" + str(pin))
-                    fd.closed
             else:
                 config.pki_log.info(log.PKIHELPER_PASSWORD_CONF_1, path,
                                     extra = config.PKI_INDENTATION_LEVEL_2)
@@ -2019,7 +2078,6 @@ class password:
                     else:
                         fd.write(master['pki_self_signed_token'] + \
                                  "=" + str(pin))
-                fd.closed
         except OSError as exc:
             config.pki_log.error(log.PKI_OSERROR_1, exc,
                                  extra = config.PKI_INDENTATION_LEVEL_2)
@@ -2027,7 +2085,8 @@ class password:
                 raise
         return
 
-    def create_client_pkcs12_password_conf(self, path, overwrite_flag = False,
+    @staticmethod
+    def create_client_pkcs12_password_conf(path, overwrite_flag = False,
                                            critical_failure = True):
         try:
             if os.path.exists(path):
@@ -2038,14 +2097,12 @@ class password:
                     # overwrite the existing 'pkcs12_password.conf' file
                     with open(path, "wt") as fd:
                         fd.write(master['pki_client_pkcs12_password'])
-                    fd.closed
             else:
                 config.pki_log.info(log.PKIHELPER_PASSWORD_CONF_1, path,
                                     extra = config.PKI_INDENTATION_LEVEL_2)
                 # create a new 'pkcs12_password.conf' file
                 with open(path, "wt") as fd:
                     fd.write(master['pki_client_pkcs12_password'])
-                fd.closed
         except OSError as exc:
             config.pki_log.error(log.PKI_OSERROR_1, exc,
                                  extra = config.PKI_INDENTATION_LEVEL_2)
@@ -2053,7 +2110,8 @@ class password:
                 raise
         return
 
-    def get_password(self, path, token_name, critical_failure = True):
+    @staticmethod
+    def get_password(path, token_name, critical_failure = True):
         if os.path.exists(path) and os.path.isfile(path) and\
            os.access(path, os.R_OK):
             tokens = PKIConfigParser.read_simple_configuration_file(path)
@@ -2062,7 +2120,7 @@ class password:
                 token_name = hardware_token
                 token_pwd = tokens[hardware_token]
             elif tokens.has_key(token_name):
-                   token_pwd = tokens[token_name]
+                token_pwd = tokens[token_name]
 
         if token_pwd is None or token_pwd == '':
             # TODO prompt for this password
@@ -2076,9 +2134,11 @@ class password:
         return token_pwd
 
 
-# PKI Deployment NSS 'certutil' Class
-class certutil:
-    def create_security_databases(self, path, pki_cert_database,
+class Certutil:
+    """PKI Deployment NSS 'certutil' Class"""
+    
+    @staticmethod
+    def create_security_databases(path, pki_cert_database,
                                   pki_key_database, pki_secmod_database,
                                   password_file = None, prefix = None,
                                   critical_failure = True):
@@ -2140,10 +2200,11 @@ class certutil:
                 raise
         return
 
-    def verify_certificate_exists(self, path, pki_cert_database,
+    @staticmethod
+    def verify_certificate_exists(path, pki_cert_database,
                                   pki_key_database, pki_secmod_database,
                                   token, nickname, password_file = None,
-                                  silent = True):
+                                  silent = True, critical_failure = True):
         rv = 0
         try:
             # Compose this "certutil" command
@@ -2214,7 +2275,8 @@ class certutil:
                 raise
         return True
 
-    def generate_self_signed_certificate(self, path, pki_cert_database,
+    @staticmethod
+    def generate_self_signed_certificate(path, pki_cert_database,
                                          pki_key_database, pki_secmod_database,
                                          token, nickname,
                                          subject, serial_number,
@@ -2354,7 +2416,8 @@ class certutil:
                 raise
         return
 
-    def import_cert(self, nickname, trust, input_file, password_file,
+    @staticmethod
+    def import_cert(nickname, trust, input_file, password_file,
                     path = None, token = None, critical_failure = True):
         try:
             command = ["certutil", "-A"]
@@ -2411,7 +2474,8 @@ class certutil:
                 raise
         return
 
-    def generate_certificate_request(self, subject, key_size,
+    @staticmethod
+    def generate_certificate_request(subject, key_size,
                                      password_file, noise_file,
                                      output_file = None, path = None,
                                      ascii_format = None, token = None,
@@ -2492,10 +2556,12 @@ class certutil:
                 raise
         return
 
-# pk12util class
-class pk12util:
-    def create_file(self, out_file, nickname, out_pwfile,
-                    db_pwfile, path = None):
+class PK12util:
+    """pk12util class"""
+    
+    @staticmethod
+    def create_file(out_file, nickname, out_pwfile,
+                    db_pwfile, path = None, critical_failure = True):
         try:
             command = ["pk12util"]
             if path:
@@ -2518,9 +2584,9 @@ class pk12util:
                 command.extend(["-w", out_pwfile])
             else:
                 config.pki_log.error(
-                    log.PKIHELPER_PK12UTIL_MISSING_OUTPWFILE,
+                    log.PKIHELPER_PK12UTIL_MISSING_PWFILE,
                     extra = config.PKI_INDENTATION_LEVEL_2)
-                raise Exception(log.PKIHELPER_PK12UTIL_MISSING_OUTPWFILE)
+                raise Exception(log.PKIHELPER_PK12UTIL_MISSING_PWFILE)
             if db_pwfile:
                 command.extend(["-k", db_pwfile])
             else:
@@ -2545,10 +2611,11 @@ class pk12util:
                 raise
         return
 
-
-# KRA Connector Class
-class kra_connector:
-    def deregister(self, critical_failure = False):
+class KRA_connector:
+    """KRA Connector Class"""
+    
+    @staticmethod
+    def deregister(critical_failure = False):
         try:
             # this is applicable to KRAs only
             if master['pki_subsystem_type'] != "kra":
@@ -2597,7 +2664,7 @@ class kra_connector:
             else:
                 token_name = "internal"
 
-            token_pwd = password.get_password(
+            token_pwd = Password.get_password(
                             master['pki_shared_password_conf'],
                             token_name,
                             critical_failure)
@@ -2615,7 +2682,7 @@ class kra_connector:
                 else:
                     return
 
-            self.execute_using_sslget(caport, cahost, subsystemnick,
+            KRA_connector.execute_using_sslget(caport, cahost, subsystemnick,
                                  token_pwd, krahost, kraport)
 
         except subprocess.CalledProcessError as exc:
@@ -2630,7 +2697,8 @@ class kra_connector:
                 raise
         return
 
-    def execute_using_pki(self, caport, cahost, subsystemnick,
+    @staticmethod
+    def execute_using_pki(caport, cahost, subsystemnick,
       token_pwd, krahost, kraport, critical_failure = False):
         command = "/bin/pki -p '{}' -h '{}' -n '{}' -P https -d '{}' -c '{}' "\
                   "kraconnector-del {} {}".format(
@@ -2654,7 +2722,8 @@ class kra_connector:
         if critical_failure == True:
             raise Exception(log.PKI_SUBPROCESS_ERROR_1 % output)
 
-    def execute_using_sslget(self, caport, cahost, subsystemnick,
+    @staticmethod
+    def execute_using_sslget(caport, cahost, subsystemnick,
       token_pwd, krahost, kraport):
         urlheader = "https://{}:{}".format(cahost, caport)
         updateURL = "/ca/rest/admin/kraconnector/remove"
@@ -2677,9 +2746,11 @@ class kra_connector:
                                          stderr = subprocess.STDOUT,
                                          shell = True)
 
-# PKI Deployment Security Domain Class
-class security_domain:
-    def deregister(self, install_token, critical_failure = False):
+class Security_domain:
+    """PKI Deployment Security Domain Class"""
+    
+    @staticmethod
+    def deregister(install_token, critical_failure = False):
         # process this PKI subsystem instance's 'CS.cfg'
         cs_cfg = PKIConfigParser.read_simple_configuration_file(
             master['pki_target_cs_cfg'])
@@ -2755,11 +2826,11 @@ class security_domain:
                     log.PKIHELPER_SECURITY_DOMAIN_UNREACHABLE_1,
                     secname,
                     extra = config.PKI_INDENTATION_LEVEL_2)
-                output = self.update_domain_using_agent_port(typeval,
+                output = Security_domain.update_domain_using_agent_port(typeval,
                     secname, params, updateURL, sechost, secagentport,
                     critical_failure)
         else:
-            output = self.update_domain_using_agent_port(typeval,
+            output = Security_domain.update_domain_using_agent_port(typeval,
                 secname, params, updateURL, sechost, secagentport,
                 critical_failure)
 
@@ -2807,7 +2878,8 @@ class security_domain:
                 secname,
                 extra = config.PKI_INDENTATION_LEVEL_2)
 
-    def update_domain_using_agent_port(self, typeval, secname, params,
+    @staticmethod
+    def update_domain_using_agent_port(typeval, secname, params,
         updateURL, sechost, secagentport, critical_failure = False):
         token_pwd = None
         cs_cfg = PKIConfigParser.read_simple_configuration_file(
@@ -2835,7 +2907,7 @@ class security_domain:
         else:
             token_name = "internal"
 
-        token_pwd = password.get_password(
+        token_pwd = Password.get_password(
                         master['pki_shared_password_conf'],
                         token_name,
                         critical_failure)
@@ -2881,8 +2953,8 @@ class security_domain:
 
         return None
 
-
-    def get_installation_token(self, secuser, secpass, critical_failure = True):
+    @staticmethod
+    def get_installation_token(secuser, secpass, critical_failure = True):
         token = None
 
         if not secuser or not secpass:
@@ -2938,9 +3010,11 @@ class security_domain:
                 raise
         return None
 
-# PKI Deployment 'systemd' Execution Management Class
-class systemd:
-    def start(self, critical_failure = True):
+class Systemd:
+    """PKI Deployment 'systemd' Execution Management Class"""
+    
+    @staticmethod
+    def start(critical_failure = True):
         try:
             # Compose this "systemd" execution management command
             if master['pki_subsystem'] in config.PKI_APACHE_SUBSYSTEMS:
@@ -2966,7 +3040,8 @@ class systemd:
                 raise
         return
 
-    def stop(self, critical_failure = True):
+    @staticmethod
+    def stop(critical_failure = True):
         try:
             # Compose this "systemd" execution management command
             if master['pki_subsystem'] in config.PKI_APACHE_SUBSYSTEMS:
@@ -2992,7 +3067,8 @@ class systemd:
                 raise
         return
 
-    def restart(self, critical_failure = True):
+    @staticmethod
+    def restart(critical_failure = True):
         try:
             # Compose this "systemd" execution management command
             if master['pki_subsystem'] in config.PKI_APACHE_SUBSYSTEMS:
@@ -3019,20 +3095,21 @@ class systemd:
         return
 
 
-class config_client:
+class Config_client:
 
-    def configure_pki_data(self, data):
+    @staticmethod
+    def configure_pki_data(data):
         config.pki_log.info(log.PKI_CONFIG_CONFIGURING_PKI_DATA,
                              extra = config.PKI_INDENTATION_LEVEL_2)
 
-        self.connection = pki.client.PKIConnection(
+        connection = pki.client.PKIConnection(
             protocol = 'https',
             hostname = master['pki_hostname'],
             port = master['pki_https_port'],
             subsystem = master['pki_subsystem_type'])
 
         try:
-            client = pki.system.SystemConfigClient(self.connection)
+            client = pki.system.SystemConfigClient(connection)
             response = client.configure(data)
 
             config.pki_log.debug(log.PKI_CONFIG_RESPONSE_STATUS + \
@@ -3055,7 +3132,7 @@ class config_client:
                         config.pki_log.info(log.PKI_CONFIG_EXTERNAL_CSR_SAVE + \
                             " '" + master['pki_external_csr_path'] + "'",
                             extra = config.PKI_INDENTATION_LEVEL_2)
-                        directory.create(
+                        Directory.create(
                             os.path.dirname(master['pki_external_csr_path']))
                         with open(master['pki_external_csr_path'], "w") as f:
                             f.write(cdata['request'])
@@ -3075,7 +3152,7 @@ class config_client:
             if not config.str2bool(master['pki_clone']) and \
                not config.str2bool(master['pki_import_admin_cert']):
                 admin_cert = response['adminCert']['cert']
-                self.process_admin_cert(admin_cert)
+                Config_client.process_admin_cert(admin_cert)
 
         except Exception, e:
             if hasattr(e, 'response'):
@@ -3092,7 +3169,8 @@ class config_client:
             raise
         return
 
-    def process_admin_cert(self, admin_cert):
+    @staticmethod
+    def process_admin_cert(admin_cert):
         config.pki_log.debug(log.PKI_CONFIG_RESPONSE_ADMIN_CERT + \
                              " " + admin_cert,
                              extra = config.PKI_INDENTATION_LEVEL_2)
@@ -3120,7 +3198,7 @@ class config_client:
 
         # Import the Administration Certificate
         # into the client NSS security database
-        certutil.import_cert(
+        Certutil.import_cert(
             re.sub("&#39;", "'", master['pki_admin_nickname']),
             "u,u,u",
             admin_cert_bin_file,
@@ -3130,12 +3208,12 @@ class config_client:
             True)
 
         # create directory for p12 file if it does not exist
-        directory.create(os.path.dirname(
+        Directory.create(os.path.dirname(
             master['pki_client_admin_cert_p12']))
 
         # Export the Administration Certificate from the
         # client NSS security database into a PKCS #12 file
-        pk12util.create_file(
+        PK12util.create_file(
             master['pki_client_admin_cert_p12'],
             re.sub("&#39;", "'", master['pki_admin_nickname']),
             master['pki_client_pkcs12_password_conf'],
@@ -3145,8 +3223,8 @@ class config_client:
         os.chmod(master['pki_client_admin_cert_p12'],
             config.PKI_DEPLOYMENT_DEFAULT_SECURITY_DATABASE_PERMISSIONS)
 
-
-    def construct_pki_configuration_data(self):
+    @staticmethod
+    def construct_pki_configuration_data():
         config.pki_log.info(log.PKI_CONFIG_CONSTRUCTING_PKI_DATA,
                              extra = config.PKI_INDENTATION_LEVEL_2)
 
@@ -3159,12 +3237,12 @@ class config_client:
         # Cloning parameters
         if master['pki_instance_type'] == "Tomcat":
             if config.str2bool(master['pki_clone']):
-                self.set_cloning_parameters(data)
+                Config_client.set_cloning_parameters(data)
             else:
                 data.isClone = "false"
 
         # Hierarchy
-        self.set_hierarchy_parameters(data)
+        Config_client.set_hierarchy_parameters(data)
 
         # Security Domain
         if master['pki_subsystem'] != "CA" or\
@@ -3173,38 +3251,39 @@ class config_client:
             # PKI KRA, PKI OCSP, PKI RA, PKI TKS, PKI TPS,
             # CA Clone, KRA Clone, OCSP Clone, TKS Clone, or
             # Subordinate CA
-            self.set_existing_security_domain(data)
+            Config_client.set_existing_security_domain(data)
         else:
             # PKI CA or External CA
-            self.set_new_security_domain(data)
+            Config_client.set_new_security_domain(data)
 
         # database
         if master['pki_subsystem'] != "RA":
-            self.set_database_parameters(data)
+            Config_client.set_database_parameters(data)
 
         # backup
         if master['pki_instance_type'] == "Tomcat":
-            self.set_backup_parameters(data)
+            Config_client.set_backup_parameters(data)
 
         # admin user
         if not config.str2bool(master['pki_clone']):
-            self.set_admin_parameters(data)
+            Config_client.set_admin_parameters(data)
 
         # Issuing CA Information
-        self.set_issuing_ca_parameters(data)
+        Config_client.set_issuing_ca_parameters(data)
 
         # Create system certs
-        self.set_system_certs(data)
+        Config_client.set_system_certs(data)
 
         return data
-
-    def set_system_certs(self, data):
+    
+    @staticmethod
+    def set_system_certs(data):
         systemCerts = []
 
         # Create 'CA Signing Certificate'
         if master['pki_subsystem'] == "CA":
             if not config.str2bool(master['pki_clone']):
-                cert1 = self.create_system_cert("ca_signing")
+                cert1 = Config_client.create_system_cert("ca_signing")
                 cert1.signingAlgorithm = \
                     master['pki_ca_signing_signing_algorithm']
                 if config.str2bool(master['pki_external_step_two']):
@@ -3232,7 +3311,7 @@ class config_client:
             if master['pki_subsystem'] == "CA" or\
                master['pki_subsystem'] == "OCSP":
                 # External CA, Subordinate CA, PKI CA, or PKI OCSP
-                cert2 = self.create_system_cert("ocsp_signing")
+                cert2 = Config_client.create_system_cert("ocsp_signing")
                 cert2.signingAlgorithm = \
                     master['pki_ocsp_signing_signing_algorithm']
                 systemCerts.append(cert2)
@@ -3242,7 +3321,7 @@ class config_client:
 
         # create new sslserver cert only if this is a new instance
         cert3 = None
-        system_list = instance.tomcat_instance_subsystems()
+        system_list = Instance.tomcat_instance_subsystems()
         if len(system_list) >= 2:
             data.generateServerCert = "false"
             for subsystem in system_list:
@@ -3253,18 +3332,18 @@ class config_client:
                     cert3 = self.retrieve_existing_server_cert(dst)
                     break
         else:
-            cert3 = self.create_system_cert("ssl_server")
+            cert3 = Config_client.create_system_cert("ssl_server")
         systemCerts.append(cert3)
 
         # Create 'Subsystem Certificate'
         if not config.str2bool(master['pki_clone']):
-            cert4 = self.create_system_cert("subsystem")
+            cert4 = Config_client.create_system_cert("subsystem")
             systemCerts.append(cert4)
 
         # Create 'Audit Signing Certificate'
         if not config.str2bool(master['pki_clone']):
             if master['pki_subsystem'] != "RA":
-                cert5 = self.create_system_cert("audit_signing")
+                cert5 = Config_client.create_system_cert("audit_signing")
                 cert5.signingAlgorithm = \
                     master['pki_audit_signing_signing_algorithm']
                 systemCerts.append(cert5)
@@ -3272,15 +3351,16 @@ class config_client:
         # Create DRM Transport and storage Certificates
         if not config.str2bool(master['pki_clone']):
             if master['pki_subsystem'] == "KRA":
-                cert6 = self.create_system_cert("transport")
+                cert6 = Config_client.create_system_cert("transport")
                 systemCerts.append(cert6)
 
-                cert7 = self.create_system_cert("storage")
+                cert7 = Config_client.create_system_cert("storage")
                 systemCerts.append(cert7)
 
         data.systemCerts = systemCerts
 
-    def set_cloning_parameters(self, data):
+    @staticmethod
+    def set_cloning_parameters(data):
         data.isClone = "true"
         data.cloneUri = master['pki_clone_uri']
         data.p12File = master['pki_clone_pkcs12_path']
@@ -3295,7 +3375,8 @@ class config_client:
             data.cloneReplicationPort = \
                 master['pki_clone_replication_clone_port']
 
-    def set_hierarchy_parameters(self, data):
+    @staticmethod
+    def set_hierarchy_parameters(data):
         if master['pki_subsystem'] == "CA":
             if config.str2bool(master['pki_clone']):
                 # Cloned CA
@@ -3310,17 +3391,19 @@ class config_client:
                 # PKI CA
                 data.hierarchy = "root"
 
-    def set_existing_security_domain(self, data):
+    @staticmethod
+    def set_existing_security_domain(data):
         data.securityDomainType = "existingdomain"
         data.securityDomainUri = master['pki_security_domain_uri']
         data.securityDomainUser = master['pki_security_domain_user']
         data.securityDomainPassword = master['pki_security_domain_password']
-
-    def set_new_security_domain(self, data):
+    @staticmethod
+    def set_new_security_domain(data):
         data.securityDomainType = "newdomain"
         data.securityDomainName = master['pki_security_domain_name']
 
-    def set_database_parameters(self, data):
+    @staticmethod
+    def set_database_parameters(data):
         data.dsHost = master['pki_ds_hostname']
         data.dsPort = master['pki_ds_ldap_port']
         data.baseDN = master['pki_ds_base_dn']
@@ -3336,15 +3419,17 @@ class config_client:
         else:
             data.secureConn = "false"
 
-    def set_backup_parameters(self, data):
+    @staticmethod
+    def set_backup_parameters(data):
         if config.str2bool(master['pki_backup_keys']):
             data.backupKeys = "true"
             data.backupFile = master['pki_backup_keys_p12']
             data.backupPassword = master['pki_backup_password']
         else:
             data.backupKeys = "false"
-
-    def set_admin_parameters(self, data):
+ 
+    @staticmethod
+    def set_admin_parameters(data):
         data.adminEmail = master['pki_admin_email']
         data.adminName = master['pki_admin_name']
         data.adminPassword = master['pki_admin_password']
@@ -3369,10 +3454,10 @@ class config_client:
                 output_file = os.path.join(
                     master['pki_client_database_dir'], "admin_pkcs10.bin")
 
-                file.generate_noise_file(
+                File.generate_noise_file(
                     noise_file, int(master['pki_admin_keysize']))
 
-                certutil.generate_certificate_request(
+                Certutil.generate_certificate_request(
                                      master['pki_admin_subject_dn'],
                                      master['pki_admin_keysize'],
                                      master['pki_client_password_conf'],
@@ -3395,7 +3480,8 @@ class config_client:
                 print "log.PKI_CONFIG_PKCS10_SUPPORT_ONLY"
                 raise Exception(log.PKI_CONFIG_PKCS10_SUPPORT_ONLY)
 
-    def set_issuing_ca_parameters(self, data):
+    @staticmethod
+    def set_issuing_ca_parameters(data):
         if master['pki_subsystem'] != "CA" or\
            config.str2bool(master['pki_clone']) or\
            config.str2bool(master['pki_subordinate']) or\
@@ -3409,7 +3495,8 @@ class config_client:
                 # External CA Step 2
                 data.stepTwo = "true";
 
-    def create_system_cert(self, tag):
+    @staticmethod
+    def create_system_cert(tag):
         cert = pki.system.SystemCertData()
         cert.tag = master["pki_%s_tag" % tag]
         cert.keyAlgorithm = master["pki_%s_key_algorithm" % tag]
@@ -3420,7 +3507,8 @@ class config_client:
         cert.token = master["pki_%s_token" % tag]
         return cert
 
-    def retrieve_existing_server_cert(self, cfg_file):
+    @staticmethod
+    def retrieve_existing_server_cert(cfg_file):
         cs_cfg = PKIConfigParser.read_simple_configuration_file(cfg_file)
         cstype = cs_cfg.get('cs.type').lower()
         cert = pki.system.SystemCertData()
@@ -3435,19 +3523,3 @@ class config_client:
         cert.token = cs_cfg.get(cstype + ".sslserver.tokenname")
         return cert
 
-# PKI Deployment Helper Class Instances
-identity = identity()
-namespace = namespace()
-configuration_file = configuration_file()
-# xml_file = xml_file()
-instance = instance()
-directory = directory()
-file = file()
-symlink = symlink()
-war = war()
-password = password()
-certutil = certutil()
-pk12util = pk12util()
-security_domain = security_domain()
-kra_connector = kra_connector()
-systemd = systemd()
diff --git a/base/server/src/scriptlets/configuration.py b/base/server/src/scriptlets/configuration.py
index 43f8c16cd1a67e2feb8386050ff6fcfa01d52621..1ded5e566055446895d5dd9116fd772ae7b0fe73 100644
--- a/base/server/src/scriptlets/configuration.py
+++ b/base/server/src/scriptlets/configuration.py
@@ -44,58 +44,58 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
 
         # Place "slightly" less restrictive permissions on
         # the top-level client directory ONLY
-        util.directory.create(master['pki_client_subsystem_dir'],
+        util.Directory.create(master['pki_client_subsystem_dir'],
             uid=0, gid=0,
             perms=config.PKI_DEPLOYMENT_DEFAULT_CLIENT_DIR_PERMISSIONS)
         # Since 'certutil' does NOT strip the 'token=' portion of
         # the 'token=password' entries, create a client password file
         # which ONLY contains the 'password' for the purposes of
         # allowing 'certutil' to generate the security databases
-        util.password.create_password_conf(
+        util.Password.create_password_conf(
             master['pki_client_password_conf'],
             master['pki_client_database_password'], pin_sans_token=True)
-        util.file.modify(master['pki_client_password_conf'],
+        util.File.modify(master['pki_client_password_conf'],
                          uid=0, gid=0)
         # Similarly, create a simple password file containing the
         # PKCS #12 password used when exporting the "Admin Certificate"
         # into a PKCS #12 file
-        util.password.create_client_pkcs12_password_conf(
+        util.Password.create_client_pkcs12_password_conf(
             master['pki_client_pkcs12_password_conf'])
-        util.file.modify(master['pki_client_pkcs12_password_conf'])
-        util.directory.create(master['pki_client_database_dir'],
+        util.File.modify(master['pki_client_pkcs12_password_conf'])
+        util.Directory.create(master['pki_client_database_dir'],
                               uid=0, gid=0)
-        util.certutil.create_security_databases(
+        util.Certutil.create_security_databases(
             master['pki_client_database_dir'],
             master['pki_client_cert_database'],
             master['pki_client_key_database'],
             master['pki_client_secmod_database'],
             password_file=master['pki_client_password_conf'])
-        util.symlink.create(master['pki_systemd_service'],
+        util.Symlink.create(master['pki_systemd_service'],
                             master['pki_systemd_service_link'])
 
         # Start/Restart this Apache/Tomcat PKI Process
         if master['pki_subsystem'] in config.PKI_APACHE_SUBSYSTEMS:
-            apache_instance_subsystems =\
-                util.instance.apache_instance_subsystems()
+            apache_instance_subsystems = \
+                util.Instance.apache_instance_subsystems()
             if apache_instance_subsystems == 1:
-                util.systemd.start()
+                util.Systemd.start()
             elif apache_instance_subsystems > 1:
-                util.systemd.restart()
+                util.Systemd.restart()
         elif master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS:
             # Optionally prepare to enable a java debugger
             # (e. g. - 'eclipse'):
             if config.str2bool(master['pki_enable_java_debugger']):
                 config.prepare_for_an_external_java_debugger(
                     master['pki_target_tomcat_conf_instance_id'])
-            tomcat_instance_subsystems =\
-                len(util.instance.tomcat_instance_subsystems())
+            tomcat_instance_subsystems = \
+                len(util.Instance.tomcat_instance_subsystems())
             if tomcat_instance_subsystems == 1:
-                util.systemd.start()
+                util.Systemd.start()
             elif tomcat_instance_subsystems > 1:
-                util.systemd.restart()
+                util.Systemd.restart()
 
         # wait for startup
-        status = util.instance.wait_for_startup(60)
+        status = util.Instance.wait_for_startup(60)
         if status == None:
             config.pki_log.error("server failed to restart",
                     extra=config.PKI_INDENTATION_LEVEL_2)
@@ -105,7 +105,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
         if config.str2bool(master['pki_enable_java_debugger']):
             config.wait_to_attach_an_external_java_debugger()
 
-        config_client = util.config_client()
         # Construct PKI Subsystem Configuration Data
         data = None
         if master['pki_instance_type'] == "Apache":
@@ -114,17 +113,17 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
                     master['pki_subsystem'],
                     extra=config.PKI_INDENTATION_LEVEL_2)
                 return rv
-        elif master['pki_subsystem'] == "TPS":
+            elif master['pki_subsystem'] == "TPS":
                 config.pki_log.info(log.PKI_CONFIG_NOT_YET_IMPLEMENTED_1,
                     master['pki_subsystem'],
                     extra=config.PKI_INDENTATION_LEVEL_2)
                 return rv
         elif master['pki_instance_type'] == "Tomcat":
             # CA, KRA, OCSP, or TKS
-            data = config_client.construct_pki_configuration_data()
+            data = util.Config_client().construct_pki_configuration_data()
         
         # Configure the substem
-        config_client.configure_pki_data(
+        util.Config_client().configure_pki_data(
             json.dumps(data, cls=pki.encoder.CustomTypeEncoder))
 
         return self.rv
@@ -133,13 +132,13 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
         config.pki_log.info(log.CONFIGURATION_DESTROY_1, __name__,
                             extra=config.PKI_INDENTATION_LEVEL_1)
         if master['pki_subsystem'] in config.PKI_APACHE_SUBSYSTEMS and\
-           util.instance.apache_instance_subsystems() == 1:
-            if util.directory.exists(master['pki_client_dir']):
-                util.directory.delete(master['pki_client_dir'])
-            util.symlink.delete(master['pki_systemd_service_link'])
+           util.Instance.apache_instance_subsystems() == 1:
+            if util.Directory.exists(master['pki_client_dir']):
+                util.Directory.delete(master['pki_client_dir'])
+            util.Symlink.delete(master['pki_systemd_service_link'])
         elif master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS and\
-             len(util.instance.tomcat_instance_subsystems()) == 1:
-            if util.directory.exists(master['pki_client_dir']):
-                util.directory.delete(master['pki_client_dir'])
-            util.symlink.delete(master['pki_systemd_service_link'])
+             len(util.Instance.tomcat_instance_subsystems()) == 1:
+            if util.Directory.exists(master['pki_client_dir']):
+                util.Directory.delete(master['pki_client_dir'])
+            util.Symlink.delete(master['pki_systemd_service_link'])
         return self.rv
diff --git a/base/server/src/scriptlets/finalization.py b/base/server/src/scriptlets/finalization.py
index 6da46469cdb58dc72ec4a9a2dee951c41c963b28..8f325005a6ad84705b07bda3d458987ded097341 100644
--- a/base/server/src/scriptlets/finalization.py
+++ b/base/server/src/scriptlets/finalization.py
@@ -47,7 +47,7 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
                             extra=config.PKI_INDENTATION_LEVEL_1)
         # For debugging/auditing purposes, save a timestamped copy of
         # this configuration file in the subsystem archive
-        util.file.copy(master['pki_user_deployment_cfg_replica'],
+        util.File.copy(master['pki_user_deployment_cfg_replica'],
                        master['pki_user_deployment_cfg_spawn_archive'])
         # Save a copy of the installation manifest file
         config.pki_log.info(log.PKI_MANIFEST_MESSAGE_1, master['pki_manifest'],
@@ -56,15 +56,15 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
         #     print tuple(record)
         manifest.file.register(master['pki_manifest'])
         manifest.file.write()
-        util.file.modify(master['pki_manifest'], silent=True)
+        util.File.modify(master['pki_manifest'], silent=True)
 
         # Also, for debugging/auditing purposes, save a timestamped copy of
         # this installation manifest file
-        util.file.copy(master['pki_manifest'],
+        util.File.copy(master['pki_manifest'],
                        master['pki_manifest_spawn_archive'])
         # Optionally, programmatically 'restart' the configured PKI instance
         if config.str2bool(master['pki_restart_configured_instance']):
-            util.systemd.restart()
+            util.Systemd.restart()
         # Optionally, 'purge' the entire temporary client infrastructure
         # including the client NSS security databases and password files
         #
@@ -73,35 +73,35 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
         #               be deleted!
         #
         if config.str2bool(master['pki_client_database_purge']):
-            if util.directory.exists(master['pki_client_subsystem_dir']):
-                util.directory.delete(master['pki_client_subsystem_dir'])
+            if util.Directory.exists(master['pki_client_subsystem_dir']):
+                util.Directory.delete(master['pki_client_subsystem_dir'])
         # If instance has not been configured, print the
         # configuration URL to the log
         if config.str2bool(master['pki_skip_configuration']):
-            util.configuration_file.log_configuration_url()
+            util.Configuration_file.log_configuration_url()
         # Log final process messages
         config.pki_log.info(log.PKISPAWN_END_MESSAGE_2,
                             master['pki_subsystem'],
                             master['pki_instance_name'],
                             extra=config.PKI_INDENTATION_LEVEL_0)
-        util.file.modify(master['pki_spawn_log'], silent=True)
+        util.File.modify(master['pki_spawn_log'], silent=True)
         # If instance has not been configured, print the
         # configuration URL to the screen
         if config.str2bool(master['pki_skip_configuration']):
-            util.configuration_file.display_configuration_url()
+            util.Configuration_file.display_configuration_url()
         return self.rv
 
     def destroy(self):
         config.pki_log.info(log.FINALIZATION_DESTROY_1, __name__,
                             extra=config.PKI_INDENTATION_LEVEL_1)
-        util.file.modify(master['pki_destroy_log'], silent=True)
+        util.File.modify(master['pki_destroy_log'], silent=True)
         # Start this Apache/Tomcat PKI Process
         if master['pki_subsystem'] in config.PKI_APACHE_SUBSYSTEMS and\
-           util.instance.apache_instance_subsystems() >= 1:
-            util.systemd.start()
+           util.Instance.apache_instance_subsystems() >= 1:
+            util.Systemd.start()
         elif master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS and\
-           len(util.instance.tomcat_instance_subsystems()) >= 1:
-            util.systemd.start()
+           len(util.Instance.tomcat_instance_subsystems()) >= 1:
+            util.Systemd.start()
         config.pki_log.info(log.PKIDESTROY_END_MESSAGE_2,
                             master['pki_subsystem'],
                             master['pki_instance_name'],
diff --git a/base/server/src/scriptlets/infrastructure_layout.py b/base/server/src/scriptlets/infrastructure_layout.py
index f3535d7674d54f75634054966b5ae17453782b28..e76ab90556ddca55f40264ecd4f497a1e53e7827 100644
--- a/base/server/src/scriptlets/infrastructure_layout.py
+++ b/base/server/src/scriptlets/infrastructure_layout.py
@@ -52,11 +52,11 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
         # registry directories for storage of a copy of the original
         # deployment configuration file used to spawn this instance,
         # and save a copy of this file
-        util.directory.create(master['pki_registry_path'])
-        util.directory.create(master['pki_instance_type_registry_path'])
-        util.directory.create(master['pki_instance_registry_path'])
-        util.directory.create(master['pki_subsystem_registry_path'])
-        util.file.copy(master['pki_default_deployment_cfg'],
+        util.Directory.create(master['pki_registry_path'])
+        util.Directory.create(master['pki_instance_type_registry_path'])
+        util.Directory.create(master['pki_instance_registry_path'])
+        util.Directory.create(master['pki_subsystem_registry_path'])
+        util.File.copy(master['pki_default_deployment_cfg'],
                        master['pki_default_deployment_cfg_replica'])
 
         print "Storing deployment configuration into " + config.pki_master_dict['pki_user_deployment_cfg_replica'] + "."
@@ -73,10 +73,10 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
         # establish top-level infrastructure, instance, and subsystem
         # base directories and create the "registry" symbolic link that
         # the "pkidestroy" executable relies upon
-        util.directory.create(master['pki_path'])
-        util.directory.create(master['pki_instance_path'])
-        util.directory.create(master['pki_subsystem_path'])
-        util.symlink.create(master['pki_instance_registry_path'],
+        util.Directory.create(master['pki_path'])
+        util.Directory.create(master['pki_instance_path'])
+        util.Directory.create(master['pki_subsystem_path'])
+        util.Symlink.create(master['pki_instance_registry_path'],
                             master['pki_subsystem_registry_link'])
         #
         # NOTE:  If "infrastructure_layout" scriptlet execution has been
@@ -88,9 +88,9 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
         # and will already exist
         # util.directory.create(master['pki_log_path'])
         # establish top-level infrastructure configuration
-        if master['pki_configuration_path'] !=\
+        if master['pki_configuration_path'] != \
            config.PKI_DEPLOYMENT_CONFIGURATION_ROOT:
-            util.directory.create(master['pki_configuration_path'])
+            util.Directory.create(master['pki_configuration_path'])
         return self.rv
 
     def destroy(self):
@@ -98,17 +98,17 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
                             extra=config.PKI_INDENTATION_LEVEL_1)
         # remove top-level infrastructure base
         if master['pki_subsystem'] in config.PKI_SUBSYSTEMS and\
-           util.instance.pki_instance_subsystems() == 0:
+           util.Instance.pki_instance_subsystems() == 0:
             # remove top-level infrastructure base
-            util.directory.delete(master['pki_path'])
+            util.Directory.delete(master['pki_path'])
             # do NOT remove top-level infrastructure logs
             # since it now stores 'pkispawn'/'pkidestroy' logs
             # util.directory.delete(master['pki_log_path'])
             # remove top-level infrastructure configuration
-            if util.directory.is_empty(master['pki_configuration_path'])\
+            if util.Directory.is_empty(master['pki_configuration_path'])\
                and master['pki_configuration_path'] !=\
                config.PKI_DEPLOYMENT_CONFIGURATION_ROOT:
-                util.directory.delete(master['pki_configuration_path'])
+                util.Directory.delete(master['pki_configuration_path'])
             # remove top-level infrastructure registry
-            util.directory.delete(master['pki_registry_path'])
+            util.Directory.delete(master['pki_registry_path'])
         return self.rv
diff --git a/base/server/src/scriptlets/initialization.py b/base/server/src/scriptlets/initialization.py
index f3839fb059a6b8346705bbb3ec8dd3c594282e8e..5712edd4ac8dbba917677556d4608705912b38f3 100644
--- a/base/server/src/scriptlets/initialization.py
+++ b/base/server/src/scriptlets/initialization.py
@@ -48,28 +48,28 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
                config.str2bool(master['pki_external_step_two']):
                 # verify that this type of "subsystem" currently EXISTS
                 # for this "instance" (External CA Step 2)
-                util.instance.verify_subsystem_exists()
-                master['pki_skip_installation'] = "True";
+                util.Instance.verify_subsystem_exists()
+                master['pki_skip_installation'] = "True"
             else:
                 # verify that this type of "subsystem" does NOT yet
                 # exist for this "instance"
-                util.instance.verify_subsystem_does_not_exist()
+                util.Instance.verify_subsystem_does_not_exist()
                 # detect and avoid any namespace collisions
-                util.namespace.collision_detection()
+                util.Namespace.collision_detection()
         # initialize 'uid' and 'gid'
-        util.identity.add_uid_and_gid(master['pki_user'], master['pki_group'])
+        util.Identity.add_uid_and_gid(master['pki_user'], master['pki_group'])
         # establish 'uid' and 'gid'
-        util.identity.set_uid(master['pki_user'])
-        util.identity.set_gid(master['pki_group'])
+        util.Identity.set_uid(master['pki_user'])
+        util.Identity.set_gid(master['pki_group'])
         # verify existence of SENSITIVE configuration file data
-        util.configuration_file.verify_sensitive_data()
+        util.Configuration_file.verify_sensitive_data()
         # verify existence of MUTUALLY EXCLUSIVE configuration file data
-        util.configuration_file.verify_mutually_exclusive_data()
+        util.Configuration_file.verify_mutually_exclusive_data()
         # verify existence of PREDEFINED configuration file data
-        util.configuration_file.verify_predefined_configuration_file_data()
+        util.Configuration_file.verify_predefined_configuration_file_data()
         # verify selinux context of selected ports
-        util.configuration_file.populate_non_default_ports()
-        util.configuration_file.verify_selinux_ports()
+        util.Configuration_file.populate_non_default_ports()
+        util.Configuration_file.verify_selinux_ports()
         return self.rv
 
     def destroy(self):
@@ -82,22 +82,22 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
                             extra=config.PKI_INDENTATION_LEVEL_1)
         # verify that this type of "subsystem" currently EXISTS
         # for this "instance"
-        util.instance.verify_subsystem_exists()
+        util.Instance.verify_subsystem_exists()
         # verify that the command-line parameters match the values
         # that are present in the corresponding configuration file
-        util.configuration_file.verify_command_matches_configuration_file()
+        util.Configuration_file.verify_command_matches_configuration_file()
         # establish 'uid' and 'gid'
-        util.identity.set_uid(master['pki_user'])
-        util.identity.set_gid(master['pki_group'])
+        util.Identity.set_uid(master['pki_user'])
+        util.Identity.set_gid(master['pki_group'])
         # get ports to remove selinux context
-        util.configuration_file.populate_non_default_ports()
+        util.Configuration_file.populate_non_default_ports()
 
         # get deinstallation token
-        token = util.security_domain.get_installation_token(
+        token = util.Security_domain.get_installation_token(
             config.pki_secdomain_user, config.pki_secdomain_pass)
 
         # remove kra connector from CA if this is a KRA
-        util.kra_connector.deregister()
+        util.KRA_connector.deregister()
 
         # de-register instance from its Security Domain
         #
@@ -107,7 +107,7 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
         #            instance's security domain may be a part of a
         #            tightly-coupled shared instance.
         #
-        util.security_domain.deregister(token)
+        util.Security_domain.deregister(token)
         # ALWAYS Stop this Apache/Tomcat PKI Process
-        util.systemd.stop()
+        util.Systemd.stop()
         return self.rv
diff --git a/base/server/src/scriptlets/instance_layout.py b/base/server/src/scriptlets/instance_layout.py
index 07ae03e9a00c3466cdfe23410f1ebe0259c89847..4fb42e634a50d0b0d761143d43ea0fb0e2f9f6da 100644
--- a/base/server/src/scriptlets/instance_layout.py
+++ b/base/server/src/scriptlets/instance_layout.py
@@ -44,103 +44,103 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
         config.pki_log.info(log.INSTANCE_SPAWN_1, __name__,
                             extra=config.PKI_INDENTATION_LEVEL_1)
         # establish instance logs
-        util.directory.create(master['pki_instance_log_path'])
+        util.Directory.create(master['pki_instance_log_path'])
         # establish instance configuration
-        util.directory.create(master['pki_instance_configuration_path'])
+        util.Directory.create(master['pki_instance_configuration_path'])
         # establish Apache/Tomcat specific instance
         if master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS:
             # establish Tomcat instance configuration
-            util.directory.copy(master['pki_source_server_path'],
+            util.Directory.copy(master['pki_source_server_path'],
                                 master['pki_instance_configuration_path'],
                                 overwrite_flag=True)
             # establish Tomcat instance base
-            util.directory.create(master['pki_tomcat_common_path'])
-            util.directory.create(master['pki_tomcat_common_lib_path'])
+            util.Directory.create(master['pki_tomcat_common_path'])
+            util.Directory.create(master['pki_tomcat_common_lib_path'])
             # establish Tomcat instance library
-            util.directory.create(master['pki_instance_lib'])
+            util.Directory.create(master['pki_instance_lib'])
             for name in os.listdir(master['pki_tomcat_lib_path']):
-                util.symlink.create(
+                util.Symlink.create(
                     os.path.join(
                         master['pki_tomcat_lib_path'],
                         name),
                     os.path.join(
                         master['pki_instance_lib'],
                         name))
-            util.symlink.create(master['pki_instance_conf_log4j_properties'],
+            util.Symlink.create(master['pki_instance_conf_log4j_properties'],
                                 master['pki_instance_lib_log4j_properties'])
-            util.directory.create(master['pki_tomcat_tmpdir_path'])
-            util.directory.create(master['pki_tomcat_webapps_path'])
-            util.directory.create(master['pki_tomcat_work_path'])
-            util.directory.create(master['pki_tomcat_work_catalina_path'])
-            util.directory.create(master['pki_tomcat_work_catalina_host_path'])
-            util.directory.create(
+            util.Directory.create(master['pki_tomcat_tmpdir_path'])
+            util.Directory.create(master['pki_tomcat_webapps_path'])
+            util.Directory.create(master['pki_tomcat_work_path'])
+            util.Directory.create(master['pki_tomcat_work_catalina_path'])
+            util.Directory.create(master['pki_tomcat_work_catalina_host_path'])
+            util.Directory.create(
                 master['pki_tomcat_work_catalina_host_run_path'])
-            util.directory.create(
+            util.Directory.create(
                 master['pki_tomcat_work_catalina_host_subsystem_path'])
             # establish Tomcat instance logs
             # establish Tomcat instance registry
             # establish Tomcat instance convenience symbolic links
-            util.symlink.create(master['pki_tomcat_bin_path'],
+            util.Symlink.create(master['pki_tomcat_bin_path'],
                                 master['pki_tomcat_bin_link'])
-            util.symlink.create(master['pki_tomcat_systemd'],
+            util.Symlink.create(master['pki_tomcat_systemd'],
                                 master['pki_instance_systemd_link'],
                                 uid=0, gid=0)
             # establish Tomcat instance common lib jar symbolic links
-            util.symlink.create(master['pki_apache_commons_collections_jar'],
+            util.Symlink.create(master['pki_apache_commons_collections_jar'],
                 master['pki_apache_commons_collections_jar_link'])
-            util.symlink.create(master['pki_apache_commons_lang_jar'],
+            util.Symlink.create(master['pki_apache_commons_lang_jar'],
                 master['pki_apache_commons_lang_jar_link'])
-            util.symlink.create(master['pki_apache_commons_logging_jar'],
+            util.Symlink.create(master['pki_apache_commons_logging_jar'],
                 master['pki_apache_commons_logging_jar_link'])
-            util.symlink.create(master['pki_commons_codec_jar'],
+            util.Symlink.create(master['pki_commons_codec_jar'],
                 master['pki_commons_codec_jar_link'])
-            util.symlink.create(master['pki_httpclient_jar'],
+            util.Symlink.create(master['pki_httpclient_jar'],
                 master['pki_httpclient_jar_link'])
-            util.symlink.create(master['pki_httpcore_jar'],
+            util.Symlink.create(master['pki_httpcore_jar'],
                 master['pki_httpcore_jar_link'])
-            util.symlink.create(master['pki_javassist_jar'],
+            util.Symlink.create(master['pki_javassist_jar'],
                 master['pki_javassist_jar_link'])
-            util.symlink.create(master['pki_resteasy_jaxrs_api_jar'],
+            util.Symlink.create(master['pki_resteasy_jaxrs_api_jar'],
                 master['pki_resteasy_jaxrs_api_jar_link'])
-            util.symlink.create(master['pki_jettison_jar'],
+            util.Symlink.create(master['pki_jettison_jar'],
                 master['pki_jettison_jar_link'])
-            util.symlink.create(master['pki_jss_jar'],
+            util.Symlink.create(master['pki_jss_jar'],
                 master['pki_jss_jar_link'])
-            util.symlink.create(master['pki_ldapjdk_jar'],
+            util.Symlink.create(master['pki_ldapjdk_jar'],
                 master['pki_ldapjdk_jar_link'])
-            util.symlink.create(master['pki_tomcat_jar'],
+            util.Symlink.create(master['pki_tomcat_jar'],
                 master['pki_tomcat_jar_link'])
-            util.symlink.create(master['pki_resteasy_atom_provider_jar'],
+            util.Symlink.create(master['pki_resteasy_atom_provider_jar'],
                 master['pki_resteasy_atom_provider_jar_link'])
-            util.symlink.create(master['pki_resteasy_jaxb_provider_jar'],
+            util.Symlink.create(master['pki_resteasy_jaxb_provider_jar'],
                 master['pki_resteasy_jaxb_provider_jar_link'])
-            util.symlink.create(master['pki_resteasy_jaxrs_jar'],
+            util.Symlink.create(master['pki_resteasy_jaxrs_jar'],
                 master['pki_resteasy_jaxrs_jar_link'])
-            util.symlink.create(master['pki_resteasy_jettison_provider_jar'],
+            util.Symlink.create(master['pki_resteasy_jettison_provider_jar'],
                 master['pki_resteasy_jettison_provider_jar_link'])
-            util.symlink.create(master['pki_scannotation_jar'],
+            util.Symlink.create(master['pki_scannotation_jar'],
                 master['pki_scannotation_jar_link'])
             if master['pki_subsystem'] == 'TKS':
-                util.symlink.create(master['pki_symkey_jar'],
+                util.Symlink.create(master['pki_symkey_jar'],
                     master['pki_symkey_jar_link'])
-            util.symlink.create(master['pki_tomcatjss_jar'],
+            util.Symlink.create(master['pki_tomcatjss_jar'],
                 master['pki_tomcatjss_jar_link'])
-            util.symlink.create(master['pki_velocity_jar'],
+            util.Symlink.create(master['pki_velocity_jar'],
                 master['pki_velocity_jar_link'])
-            util.symlink.create(master['pki_xerces_j2_jar'],
+            util.Symlink.create(master['pki_xerces_j2_jar'],
                 master['pki_xerces_j2_jar_link'])
-            util.symlink.create(master['pki_xml_commons_apis_jar'],
+            util.Symlink.create(master['pki_xml_commons_apis_jar'],
                 master['pki_xml_commons_apis_jar_link'])
-            util.symlink.create(master['pki_xml_commons_resolver_jar'],
+            util.Symlink.create(master['pki_xml_commons_resolver_jar'],
                 master['pki_xml_commons_resolver_jar_link'])
         # establish shared NSS security databases for this instance
-        util.directory.create(master['pki_database_path'])
+        util.Directory.create(master['pki_database_path'])
         # establish instance convenience symbolic links
-        util.symlink.create(master['pki_database_path'],
+        util.Symlink.create(master['pki_database_path'],
                             master['pki_instance_database_link'])
-        util.symlink.create(master['pki_instance_configuration_path'],
+        util.Symlink.create(master['pki_instance_configuration_path'],
                             master['pki_instance_conf_link'])
-        util.symlink.create(master['pki_instance_log_path'],
+        util.Symlink.create(master['pki_instance_log_path'],
                             master['pki_instance_logs_link'])
         return self.rv
 
@@ -148,38 +148,38 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
         config.pki_log.info(log.INSTANCE_DESTROY_1, __name__,
                             extra=config.PKI_INDENTATION_LEVEL_1)
         if master['pki_subsystem'] == 'TKS':
-            util.symlink.delete(master['pki_symkey_jar_link'])
+            util.Symlink.delete(master['pki_symkey_jar_link'])
         if master['pki_subsystem'] in config.PKI_APACHE_SUBSYSTEMS and\
-           util.instance.apache_instance_subsystems() == 0:
+           util.Instance.apache_instance_subsystems() == 0:
             # remove Apache instance base
-            util.directory.delete(master['pki_instance_path'])
+            util.Directory.delete(master['pki_instance_path'])
             # remove Apache instance logs
             # remove shared NSS security database path for this instance
-            util.directory.delete(master['pki_database_path'])
+            util.Directory.delete(master['pki_database_path'])
             # remove Apache instance configuration
-            util.directory.delete(master['pki_instance_configuration_path'])
+            util.Directory.delete(master['pki_instance_configuration_path'])
             # remove Apache instance registry
-            util.directory.delete(master['pki_instance_registry_path'])
+            util.Directory.delete(master['pki_instance_registry_path'])
             # remove Apache PKI registry (if empty)
-            if util.instance.apache_instances() == 0:
-                util.directory.delete(
+            if util.Instance.apache_instances() == 0:
+                util.Directory.delete(
                     master['pki_instance_type_registry_path'])
         elif master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS and\
-             len(util.instance.tomcat_instance_subsystems()) == 0:
+             len(util.Instance.tomcat_instance_subsystems()) == 0:
             # remove Tomcat instance base
-            util.directory.delete(master['pki_instance_path'])
+            util.Directory.delete(master['pki_instance_path'])
             # remove Tomcat instance logs
-            util.directory.delete(master['pki_instance_log_path'])
+            util.Directory.delete(master['pki_instance_log_path'])
             # remove shared NSS security database path for this instance
-            util.directory.delete(master['pki_database_path'])
+            util.Directory.delete(master['pki_database_path'])
             # remove Tomcat instance configuration
-            util.directory.delete(master['pki_instance_configuration_path'])
+            util.Directory.delete(master['pki_instance_configuration_path'])
             # remove PKI 'tomcat.conf' instance file
-            util.file.delete(master['pki_target_tomcat_conf_instance_id'])
+            util.File.delete(master['pki_target_tomcat_conf_instance_id'])
             # remove Tomcat instance registry
-            util.directory.delete(master['pki_instance_registry_path'])
+            util.Directory.delete(master['pki_instance_registry_path'])
             # remove Tomcat PKI registry (if empty)
-            if util.instance.tomcat_instances() == 0:
-                util.directory.delete(
+            if util.Instance.tomcat_instances() == 0:
+                util.Directory.delete(
                     master['pki_instance_type_registry_path'])
         return self.rv
diff --git a/base/server/src/scriptlets/security_databases.py b/base/server/src/scriptlets/security_databases.py
index 029b8ebef7015a7b0711fe843558fabc742dbe07..d870db7c9897e6f15f24d0359a5d83069c398401 100644
--- a/base/server/src/scriptlets/security_databases.py
+++ b/base/server/src/scriptlets/security_databases.py
@@ -38,33 +38,33 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
             return self.rv
         config.pki_log.info(log.SECURITY_DATABASES_SPAWN_1, __name__,
                             extra=config.PKI_INDENTATION_LEVEL_1)
-        util.password.create_password_conf(
+        util.Password.create_password_conf(
             master['pki_shared_password_conf'],
             master['pki_pin'])
         # Since 'certutil' does NOT strip the 'token=' portion of
         # the 'token=password' entries, create a temporary server 'pfile'
         # which ONLY contains the 'password' for the purposes of
         # allowing 'certutil' to generate the security databases
-        util.password.create_password_conf(
+        util.Password.create_password_conf(
             master['pki_shared_pfile'],
             master['pki_pin'], pin_sans_token=True)
-        util.file.modify(master['pki_shared_password_conf'])
-        util.certutil.create_security_databases(
+        util.File.modify(master['pki_shared_password_conf'])
+        util.Certutil.create_security_databases(
             master['pki_database_path'],
             master['pki_cert_database'],
             master['pki_key_database'],
             master['pki_secmod_database'],
             password_file=master['pki_shared_pfile'])
-        util.file.modify(master['pki_cert_database'], perms=\
+        util.File.modify(master['pki_cert_database'], perms=\
             config.PKI_DEPLOYMENT_DEFAULT_SECURITY_DATABASE_PERMISSIONS)
-        util.file.modify(master['pki_key_database'], perms=\
+        util.File.modify(master['pki_key_database'], perms=\
             config.PKI_DEPLOYMENT_DEFAULT_SECURITY_DATABASE_PERMISSIONS)
-        util.file.modify(master['pki_secmod_database'], perms=\
+        util.File.modify(master['pki_secmod_database'], perms=\
             config.PKI_DEPLOYMENT_DEFAULT_SECURITY_DATABASE_PERMISSIONS)
 
-        if len(util.instance.tomcat_instance_subsystems()) < 2:
+        if len(util.Instance.tomcat_instance_subsystems()) < 2:
             # only create a self signed cert for a new instance  
-            rv = util.certutil.verify_certificate_exists(
+            rv = util.Certutil.verify_certificate_exists(
                  master['pki_database_path'],
                  master['pki_cert_database'],
                  master['pki_key_database'],
@@ -73,10 +73,10 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
                  master['pki_self_signed_nickname'],
                  password_file=master['pki_shared_pfile'])
             if not rv:
-                util.file.generate_noise_file(
+                util.File.generate_noise_file(
                     master['pki_self_signed_noise_file'],
                     master['pki_self_signed_noise_bytes'])
-                util.certutil.generate_self_signed_certificate(
+                util.Certutil.generate_self_signed_certificate(
                     master['pki_database_path'],
                     master['pki_cert_database'],
                     master['pki_key_database'],
@@ -91,24 +91,24 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
                     master['pki_self_signed_noise_file'],
                     password_file=master['pki_shared_pfile'])
                 # Delete the temporary 'noise' file
-                util.file.delete(master['pki_self_signed_noise_file'])
+                util.File.delete(master['pki_self_signed_noise_file'])
             # Delete the temporary 'pfile'
-            util.file.delete(master['pki_shared_pfile'])
+            util.File.delete(master['pki_shared_pfile'])
         return self.rv
 
     def destroy(self):
         config.pki_log.info(log.SECURITY_DATABASES_DESTROY_1, __name__,
                             extra=config.PKI_INDENTATION_LEVEL_1)
         if master['pki_subsystem'] in config.PKI_APACHE_SUBSYSTEMS and\
-           util.instance.apache_instance_subsystems() == 0:
-            util.file.delete(master['pki_cert_database'])
-            util.file.delete(master['pki_key_database'])
-            util.file.delete(master['pki_secmod_database'])
-            util.file.delete(master['pki_shared_password_conf'])
+           util.Instance.apache_instance_subsystems() == 0:
+            util.File.delete(master['pki_cert_database'])
+            util.File.delete(master['pki_key_database'])
+            util.File.delete(master['pki_secmod_database'])
+            util.File.delete(master['pki_shared_password_conf'])
         elif master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS and\
-             len(util.instance.tomcat_instance_subsystems()) == 0:
-            util.file.delete(master['pki_cert_database'])
-            util.file.delete(master['pki_key_database'])
-            util.file.delete(master['pki_secmod_database'])
-            util.file.delete(master['pki_shared_password_conf'])
+             len(util.Instance.tomcat_instance_subsystems()) == 0:
+            util.File.delete(master['pki_cert_database'])
+            util.File.delete(master['pki_key_database'])
+            util.File.delete(master['pki_secmod_database'])
+            util.File.delete(master['pki_shared_password_conf'])
         return self.rv
diff --git a/base/server/src/scriptlets/selinux_setup.py b/base/server/src/scriptlets/selinux_setup.py
index 684a4ce2a0d14337f20730399d116aec27c5b186..ae4ae540e6e85de78b7a87f0751cf2aa88d8b66f 100644
--- a/base/server/src/scriptlets/selinux_setup.py
+++ b/base/server/src/scriptlets/selinux_setup.py
@@ -69,9 +69,9 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
 
                 # add SELinux contexts when adding the first subsystem
                 if master['pki_subsystem'] in config.PKI_APACHE_SUBSYSTEMS and\
-                    util.instance.apache_instance_subsystems() == 1 or\
+                    util.Instance.apache_instance_subsystems() == 1 or\
                     master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS and\
-                    len(util.instance.tomcat_instance_subsystems()) == 1:
+                    len(util.Instance.tomcat_instance_subsystems()) == 1:
 
                     trans = seobject.semanageRecords("targeted")
                     trans.start()
@@ -139,7 +139,7 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
         # check first if any transactions are required
         if len(ports) == 0 and master['pki_instance_name'] == \
            config.PKI_DEPLOYMENT_DEFAULT_TOMCAT_INSTANCE_NAME:
-               return self.rv
+            return self.rv
         # A maximum of 10 tries to delete the SELinux contexts
         counter = 1
         max_tries = 10
@@ -147,9 +147,9 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
             try:
                 # remove SELinux contexts when removing the last subsystem
                 if master['pki_subsystem'] in config.PKI_APACHE_SUBSYSTEMS and\
-                    util.instance.apache_instance_subsystems() == 0 or\
+                    util.Instance.apache_instance_subsystems() == 0 or\
                     master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS and\
-                    len(util.instance.tomcat_instance_subsystems()) == 0:
+                    len(util.Instance.tomcat_instance_subsystems()) == 0:
 
                     trans = seobject.semanageRecords("targeted")
                     trans.start()
diff --git a/base/server/src/scriptlets/slot_substitution.py b/base/server/src/scriptlets/slot_substitution.py
index 7904762cc6914b3951b4102f10bf66f6bc70a00e..9cef6a55339d561417fbf5a0a5b35dfc2bfa1240 100644
--- a/base/server/src/scriptlets/slot_substitution.py
+++ b/base/server/src/scriptlets/slot_substitution.py
@@ -39,39 +39,39 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
             return self.rv
         config.pki_log.info(log.SLOT_ASSIGNMENT_SPAWN_1, __name__,
                             extra=config.PKI_INDENTATION_LEVEL_1)
-        util.file.copy_with_slot_substitution(master['pki_source_cs_cfg'],
+        util.File.copy_with_slot_substitution(master['pki_source_cs_cfg'],
                                               master['pki_target_cs_cfg'])
-        util.file.copy_with_slot_substitution(master['pki_source_registry'],
+        util.File.copy_with_slot_substitution(master['pki_source_registry'],
                                               master['pki_target_registry'],
                                               uid=0, gid=0, overwrite_flag=True)
         if master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS:
-            util.file.copy_with_slot_substitution(
+            util.File.copy_with_slot_substitution(
                 master['pki_source_catalina_properties'],
                 master['pki_target_catalina_properties'],
                 overwrite_flag=True)
-            util.file.copy_with_slot_substitution(
+            util.File.copy_with_slot_substitution(
                 master['pki_source_servercertnick_conf'],
                 master['pki_target_servercertnick_conf'],
                 overwrite_flag=True)
-            util.file.copy_with_slot_substitution(
+            util.File.copy_with_slot_substitution(
                 master['pki_source_server_xml'],
                 master['pki_target_server_xml'],
                 overwrite_flag=True)
-            util.file.copy_with_slot_substitution(
+            util.File.copy_with_slot_substitution(
                 master['pki_source_context_xml'],
                 master['pki_target_context_xml'],
                 overwrite_flag=True)
-            util.file.copy_with_slot_substitution(
+            util.File.copy_with_slot_substitution(
                 master['pki_source_tomcat_conf'],
                 master['pki_target_tomcat_conf_instance_id'],
                 uid=0, gid=0, overwrite_flag=True)
-            util.file.copy_with_slot_substitution(
+            util.File.copy_with_slot_substitution(
                 master['pki_source_tomcat_conf'],
                 master['pki_target_tomcat_conf'],
                 overwrite_flag=True)
-            util.file.apply_slot_substitution(
+            util.File.apply_slot_substitution(
                 master['pki_target_velocity_properties'])
-            util.file.apply_slot_substitution(
+            util.File.apply_slot_substitution(
                 master['pki_target_subsystem_web_xml'])
             # Strip "<filter>" section from subsystem "web.xml"
             # This is ONLY necessary because XML comments cannot be "nested"!
@@ -83,10 +83,10 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
             #    master['pki_target_subsystem_web_xml'])
             #util.file.delete(master['pki_target_subsystem_web_xml_orig'])
             if master['pki_subsystem'] == "CA":
-                util.file.copy_with_slot_substitution(
+                util.File.copy_with_slot_substitution(
                     master['pki_source_proxy_conf'],
                     master['pki_target_proxy_conf'])
-                util.file.apply_slot_substitution(
+                util.File.apply_slot_substitution(
                     master['pki_target_profileselect_template'])
         return self.rv
 
diff --git a/base/server/src/scriptlets/subsystem_layout.py b/base/server/src/scriptlets/subsystem_layout.py
index f340ead4969bdeb5ff059890edb6a51d1428ed84..071cbe4eb83ede6f05f562ed87f4ef54a879e895 100644
--- a/base/server/src/scriptlets/subsystem_layout.py
+++ b/base/server/src/scriptlets/subsystem_layout.py
@@ -39,65 +39,65 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
         config.pki_log.info(log.SUBSYSTEM_SPAWN_1, __name__,
                             extra=config.PKI_INDENTATION_LEVEL_1)
         # establish instance-based subsystem logs
-        util.directory.create(master['pki_subsystem_log_path'])
-        util.directory.create(master['pki_subsystem_archive_log_path'])
+        util.Directory.create(master['pki_subsystem_log_path'])
+        util.Directory.create(master['pki_subsystem_archive_log_path'])
         if master['pki_subsystem'] in config.PKI_SIGNED_AUDIT_SUBSYSTEMS:
-            util.directory.create(master['pki_subsystem_signed_audit_log_path'])
+            util.Directory.create(master['pki_subsystem_signed_audit_log_path'])
         # establish instance-based subsystem configuration
-        util.directory.create(master['pki_subsystem_configuration_path'])
+        util.Directory.create(master['pki_subsystem_configuration_path'])
         # util.directory.copy(master['pki_source_conf_path'],
         #                     master['pki_subsystem_configuration_path'])
         # establish instance-based Apache/Tomcat specific subsystems
         if master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS:
             # establish instance-based Tomcat PKI subsystem base
             if master['pki_subsystem'] == "CA":
-                util.directory.copy(master['pki_source_emails'],
+                util.Directory.copy(master['pki_source_emails'],
                                     master['pki_subsystem_emails_path'])
-                util.directory.copy(master['pki_source_profiles'],
+                util.Directory.copy(master['pki_source_profiles'],
                                     master['pki_subsystem_profiles_path'])
             # establish instance-based Tomcat PKI subsystem logs
             # establish instance-based Tomcat PKI subsystem configuration
             if master['pki_subsystem'] == "CA":
-                util.file.copy(master['pki_source_flatfile_txt'],
+                util.File.copy(master['pki_source_flatfile_txt'],
                                master['pki_target_flatfile_txt'])
-                util.file.copy(master['pki_source_registry_cfg'],
+                util.File.copy(master['pki_source_registry_cfg'],
                                master['pki_target_registry_cfg'])
                 # '*.profile'
-                util.file.copy(master['pki_source_admincert_profile'],
+                util.File.copy(master['pki_source_admincert_profile'],
                                master['pki_target_admincert_profile'])
-                util.file.copy(master['pki_source_caauditsigningcert_profile'],
+                util.File.copy(master['pki_source_caauditsigningcert_profile'],
                                master['pki_target_caauditsigningcert_profile'])
-                util.file.copy(master['pki_source_cacert_profile'],
+                util.File.copy(master['pki_source_cacert_profile'],
                                master['pki_target_cacert_profile'])
-                util.file.copy(master['pki_source_caocspcert_profile'],
+                util.File.copy(master['pki_source_caocspcert_profile'],
                                master['pki_target_caocspcert_profile'])
-                util.file.copy(master['pki_source_servercert_profile'],
+                util.File.copy(master['pki_source_servercert_profile'],
                                master['pki_target_servercert_profile'])
-                util.file.copy(master['pki_source_subsystemcert_profile'],
+                util.File.copy(master['pki_source_subsystemcert_profile'],
                                master['pki_target_subsystemcert_profile'])
             elif master['pki_subsystem'] == "KRA":
                 # '*.profile'
-                util.file.copy(master['pki_source_servercert_profile'],
+                util.File.copy(master['pki_source_servercert_profile'],
                                master['pki_target_servercert_profile'])
-                util.file.copy(master['pki_source_storagecert_profile'],
+                util.File.copy(master['pki_source_storagecert_profile'],
                                master['pki_target_storagecert_profile'])
-                util.file.copy(master['pki_source_subsystemcert_profile'],
+                util.File.copy(master['pki_source_subsystemcert_profile'],
                                master['pki_target_subsystemcert_profile'])
-                util.file.copy(master['pki_source_transportcert_profile'],
+                util.File.copy(master['pki_source_transportcert_profile'],
                                master['pki_target_transportcert_profile'])
             # establish instance-based Tomcat PKI subsystem registry
             # establish instance-based Tomcat PKI subsystem convenience
             # symbolic links
-            util.symlink.create(master['pki_tomcat_webapps_path'],
+            util.Symlink.create(master['pki_tomcat_webapps_path'],
                                 master['pki_subsystem_tomcat_webapps_link'])
         # establish instance-based subsystem convenience symbolic links
-        util.symlink.create(master['pki_instance_database_link'],
+        util.Symlink.create(master['pki_instance_database_link'],
                             master['pki_subsystem_database_link'])
-        util.symlink.create(master['pki_subsystem_configuration_path'],
+        util.Symlink.create(master['pki_subsystem_configuration_path'],
                             master['pki_subsystem_conf_link'])
-        util.symlink.create(master['pki_subsystem_log_path'],
+        util.Symlink.create(master['pki_subsystem_log_path'],
                             master['pki_subsystem_logs_link'])
-        util.symlink.create(master['pki_instance_registry_path'],
+        util.Symlink.create(master['pki_instance_registry_path'],
                             master['pki_subsystem_registry_link'])
         return self.rv
 
@@ -106,16 +106,16 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
                             extra=config.PKI_INDENTATION_LEVEL_1)
         # remove instance-based subsystem base
         if master['pki_subsystem'] == "CA":
-            util.directory.delete(master['pki_subsystem_emails_path'])
-            util.directory.delete(master['pki_subsystem_profiles_path'])
-        util.directory.delete(master['pki_subsystem_path'])
+            util.Directory.delete(master['pki_subsystem_emails_path'])
+            util.Directory.delete(master['pki_subsystem_profiles_path'])
+        util.Directory.delete(master['pki_subsystem_path'])
         # remove instance-based subsystem logs
         if master['pki_subsystem'] in config.PKI_SIGNED_AUDIT_SUBSYSTEMS:
-            util.directory.delete(master['pki_subsystem_signed_audit_log_path'])
-        util.directory.delete(master['pki_subsystem_archive_log_path'])
-        util.directory.delete(master['pki_subsystem_log_path'])
+            util.Directory.delete(master['pki_subsystem_signed_audit_log_path'])
+        util.Directory.delete(master['pki_subsystem_archive_log_path'])
+        util.Directory.delete(master['pki_subsystem_log_path'])
         # remove instance-based subsystem configuration
-        util.directory.delete(master['pki_subsystem_configuration_path'])
+        util.Directory.delete(master['pki_subsystem_configuration_path'])
         # remove instance-based subsystem registry
-        util.directory.delete(master['pki_subsystem_registry_path'])
+        util.Directory.delete(master['pki_subsystem_registry_path'])
         return self.rv
diff --git a/base/server/src/scriptlets/webapp_deployment.py b/base/server/src/scriptlets/webapp_deployment.py
index 4fdcc8614baf2bc816fc865ca3bf420ba6ef5091..800d8996f34f7c238484e14d969d236fbf97d4da 100644
--- a/base/server/src/scriptlets/webapp_deployment.py
+++ b/base/server/src/scriptlets/webapp_deployment.py
@@ -47,8 +47,8 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
 
             # Copy /usr/share/pki/server/webapps/ROOT
             # to <instance>/webapps/ROOT
-            util.directory.create(master['pki_tomcat_webapps_root_path'])
-            util.directory.copy(
+            util.Directory.create(master['pki_tomcat_webapps_root_path'])
+            util.Directory.copy(
                 os.path.join(
                     config.PKI_DEPLOYMENT_SOURCE_ROOT,
                     "server",
@@ -57,20 +57,20 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
                 master['pki_tomcat_webapps_root_path'],
                 overwrite_flag=True)
 
-            util.directory.create(master['pki_tomcat_webapps_common_path'])
+            util.Directory.create(master['pki_tomcat_webapps_common_path'])
 
             # If desired and available,
             # copy selected server theme
             # to <instance>/webapps/pki
             if config.str2bool(master['pki_theme_enable']) and\
                os.path.exists(master['pki_theme_server_dir']):
-                util.directory.copy(master['pki_theme_server_dir'],
+                util.Directory.copy(master['pki_theme_server_dir'],
                                     master['pki_tomcat_webapps_common_path'],
                                     overwrite_flag=True)
 
             # Copy /usr/share/pki/server/webapps/pki/js
             # to <instance>/webapps/pki/js
-            util.directory.copy(
+            util.Directory.copy(
                 os.path.join(
                     config.PKI_DEPLOYMENT_SOURCE_ROOT,
                     "server",
@@ -84,7 +84,7 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
 
             # Copy /usr/share/pki/server/webapps/pki/META-INF
             # to <instance>/webapps/pki/META-INF
-            util.directory.copy(
+            util.Directory.copy(
                 os.path.join(
                     config.PKI_DEPLOYMENT_SOURCE_ROOT,
                     "server",
@@ -99,8 +99,8 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
             # Copy /usr/share/pki/server/webapps/pki/admin
             # to <instance>/webapps/<subsystem>/admin
             # TODO: common templates should be deployed in common webapp
-            util.directory.create(master['pki_tomcat_webapps_subsystem_path'])
-            util.directory.copy(
+            util.Directory.create(master['pki_tomcat_webapps_subsystem_path'])
+            util.Directory.copy(
                 os.path.join(
                     config.PKI_DEPLOYMENT_SOURCE_ROOT,
                     "server",
@@ -114,7 +114,7 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
 
             # Copy /usr/share/pki/<subsystem>/webapps/<subsystem>
             # to <instance>/webapps/<subsystem>
-            util.directory.copy(
+            util.Directory.copy(
                 os.path.join(
                     config.PKI_DEPLOYMENT_SOURCE_ROOT,
                     master['pki_subsystem'].lower(),
@@ -123,42 +123,42 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
                 master['pki_tomcat_webapps_subsystem_path'],
                 overwrite_flag=True)
 
-            util.directory.create(
+            util.Directory.create(
                 master['pki_tomcat_webapps_subsystem_webinf_classes_path'])
-            util.directory.create(
+            util.Directory.create(
                 master['pki_tomcat_webapps_subsystem_webinf_lib_path'])
             # establish Tomcat webapps subsystem WEB-INF lib symbolic links
-            util.symlink.create(master['pki_certsrv_jar'],
+            util.Symlink.create(master['pki_certsrv_jar'],
                 master['pki_certsrv_jar_link'])
-            util.symlink.create(master['pki_cmsbundle'],
+            util.Symlink.create(master['pki_cmsbundle'],
                 master['pki_cmsbundle_jar_link'])
-            util.symlink.create(master['pki_cmscore'],
+            util.Symlink.create(master['pki_cmscore'],
                 master['pki_cmscore_jar_link'])
-            util.symlink.create(master['pki_cms'],
+            util.Symlink.create(master['pki_cms'],
                 master['pki_cms_jar_link'])
-            util.symlink.create(master['pki_cmsutil'],
+            util.Symlink.create(master['pki_cmsutil'],
                 master['pki_cmsutil_jar_link'])
-            util.symlink.create(master['pki_nsutil'],
+            util.Symlink.create(master['pki_nsutil'],
                 master['pki_nsutil_jar_link'])
             if master['pki_subsystem'] == "CA":
-                util.symlink.create(master['pki_ca_jar'],
+                util.Symlink.create(master['pki_ca_jar'],
                                     master['pki_ca_jar_link'])
             elif master['pki_subsystem'] == "KRA":
-                util.symlink.create(master['pki_kra_jar'],
+                util.Symlink.create(master['pki_kra_jar'],
                                     master['pki_kra_jar_link'])
             elif master['pki_subsystem'] == "OCSP":
-                util.symlink.create(master['pki_ocsp_jar'],
+                util.Symlink.create(master['pki_ocsp_jar'],
                                     master['pki_ocsp_jar_link'])
             elif master['pki_subsystem'] == "TKS":
-                util.symlink.create(master['pki_tks_jar'],
+                util.Symlink.create(master['pki_tks_jar'],
                                     master['pki_tks_jar_link'])
             # set ownerships, permissions, and acls
-            util.directory.set_mode(master['pki_tomcat_webapps_subsystem_path'])
+            util.Directory.set_mode(master['pki_tomcat_webapps_subsystem_path'])
         return self.rv
 
     def destroy(self):
         if master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS:
             config.pki_log.info(log.WEBAPP_DEPLOYMENT_DESTROY_1, __name__,
                                 extra=config.PKI_INDENTATION_LEVEL_1)
-            util.directory.delete(master['pki_tomcat_webapps_subsystem_path'])
+            util.Directory.delete(master['pki_tomcat_webapps_subsystem_path'])
         return self.rv
-- 
1.7.10.2

