summaryrefslogtreecommitdiffstats
path: root/base/server/python/pki/server/deployment/scriptlets/selinux_setup.py
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-04-26 22:32:41 +0200
committerEndi S. Dewata <edewata@redhat.com>2016-04-28 16:30:31 +0200
commit69a52e1179326895632ac0b4639ed8a8523091c9 (patch)
tree2907dafa37ccedb72f8da1f0d37965822ad3f6cb /base/server/python/pki/server/deployment/scriptlets/selinux_setup.py
parent6f9d417ff906360ee2f39a432cd3faccc3f52a2e (diff)
downloadpki-69a52e1179326895632ac0b4639ed8a8523091c9.tar.gz
pki-69a52e1179326895632ac0b4639ed8a8523091c9.tar.xz
pki-69a52e1179326895632ac0b4639ed8a8523091c9.zip
Removed unused variables in deployment scriptlets.
The unused rv instance variables in all deployment scriptlets have been removed. The spawn() and destroy() are now returning None instead of error code. If an error happens during execution the scriptlet will throw an exception which will be caught by pkispawn or pkidestroy and then displayed to the user.
Diffstat (limited to 'base/server/python/pki/server/deployment/scriptlets/selinux_setup.py')
-rw-r--r--base/server/python/pki/server/deployment/scriptlets/selinux_setup.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/base/server/python/pki/server/deployment/scriptlets/selinux_setup.py b/base/server/python/pki/server/deployment/scriptlets/selinux_setup.py
index c559370a5..9c926d18f 100644
--- a/base/server/python/pki/server/deployment/scriptlets/selinux_setup.py
+++ b/base/server/python/pki/server/deployment/scriptlets/selinux_setup.py
@@ -42,7 +42,7 @@ if selinux.is_selinux_enabled():
# PKI Deployment Selinux Setup Scriptlet
class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
- rv = 0
+
suffix = "(/.*)?"
def restore_context(self, mdict):
@@ -56,12 +56,12 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
if config.str2bool(deployer.mdict['pki_skip_installation']):
config.pki_log.info(log.SKIP_SELINUX_SPAWN_1, __name__,
extra=config.PKI_INDENTATION_LEVEL_1)
- return self.rv
+ return
if not selinux.is_selinux_enabled() or seobject is None:
config.pki_log.info(log.SELINUX_DISABLED_SPAWN_1, __name__,
extra=config.PKI_INDENTATION_LEVEL_1)
- return self.rv
+ return
config.pki_log.info(log.SELINUX_SPAWN_1, __name__,
extra=config.PKI_INDENTATION_LEVEL_1)
@@ -74,7 +74,7 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
if len(ports) == 0 and deployer.mdict['pki_instance_name'] == \
config.PKI_DEPLOYMENT_DEFAULT_TOMCAT_INSTANCE_NAME:
self.restore_context(deployer.mdict)
- return self.rv
+ return
# add SELinux contexts when adding the first subsystem
if len(deployer.instance.tomcat_instance_subsystems()) == 1:
@@ -148,21 +148,21 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
else:
raise
- return self.rv
-
def destroy(self, deployer):
if not bool(selinux.is_selinux_enabled()):
config.pki_log.info(log.SELINUX_DISABLED_DESTROY_1, __name__,
extra=config.PKI_INDENTATION_LEVEL_1)
- return self.rv
+ return
+
config.pki_log.info(log.SELINUX_DESTROY_1, __name__,
extra=config.PKI_INDENTATION_LEVEL_1)
# check first if any transactions are required
if (len(ports) == 0 and deployer.mdict['pki_instance_name'] ==
config.PKI_DEPLOYMENT_DEFAULT_TOMCAT_INSTANCE_NAME):
- return self.rv
+ return
+
# A maximum of 10 tries to delete the SELinux contexts
counter = 1
max_tries = 10
@@ -234,5 +234,3 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
"Retrying to remove selinux context ...")
else:
raise
-
- return self.rv