diff options
author | Endi S. Dewata <edewata@redhat.com> | 2016-04-26 22:32:41 +0200 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2016-04-28 16:30:31 +0200 |
commit | 69a52e1179326895632ac0b4639ed8a8523091c9 (patch) | |
tree | 2907dafa37ccedb72f8da1f0d37965822ad3f6cb /base/server/sbin/pkispawn | |
parent | 6f9d417ff906360ee2f39a432cd3faccc3f52a2e (diff) | |
download | pki-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/sbin/pkispawn')
-rwxr-xr-x | base/server/sbin/pkispawn | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/base/server/sbin/pkispawn b/base/server/sbin/pkispawn index caa5e9bee..21333e722 100755 --- a/base/server/sbin/pkispawn +++ b/base/server/sbin/pkispawn @@ -514,25 +514,26 @@ def main(argv): # Process the various "scriptlets" to create the specified PKI subsystem. pki_subsystem_scriptlets = parser.mdict['spawn_scriplets'].split() deployer = util.PKIDeployer(parser.mdict, parser.slots_dict) - rv = 0 - for scriptlet_name in pki_subsystem_scriptlets: - scriptlet_module = __import__( - "pki.server.deployment.scriptlets." + scriptlet_name, - fromlist=[scriptlet_name]) - scriptlet = scriptlet_module.PkiScriptlet() - try: - rv = scriptlet.spawn(deployer) - # pylint: disable=W0703 - except Exception: - log_error_details() - print() - print("Installation failed.") - print() - sys.exit(1) - if rv != 0: - print("Nothing here!!!") - print("Installation failed.") - sys.exit(1) + + try: + for scriptlet_name in pki_subsystem_scriptlets: + + scriptlet_module = __import__( + "pki.server.deployment.scriptlets." + scriptlet_name, + fromlist=[scriptlet_name]) + + scriptlet = scriptlet_module.PkiScriptlet() + + scriptlet.spawn(deployer) + + # pylint: disable=W0703 + except Exception as e: + log_error_details() + print() + print("Installation failed: %s" % e) + print() + sys.exit(1) + config.pki_log.debug(log.PKI_DICTIONARY_MASTER, extra=config.PKI_INDENTATION_LEVEL_0) config.pki_log.debug(pkilogging.log_format(parser.mdict), |