summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-04-27 03:55:09 +0200
committerEndi S. Dewata <edewata@redhat.com>2016-05-03 02:55:52 +0200
commitaaa560fe54b2fb343d7ad80177c5f37781518392 (patch)
tree63e50bb2466107b3f51a70c074d5eb0692158716
parent4193f16053aa317af7d61ffed0e40df3be853aa9 (diff)
downloadpki-aaa560fe54b2fb343d7ad80177c5f37781518392.zip
pki-aaa560fe54b2fb343d7ad80177c5f37781518392.tar.gz
pki-aaa560fe54b2fb343d7ad80177c5f37781518392.tar.xz
Added support for fine-grained installation steps.
https://fedorahosted.org/pki/ticket/2278
-rwxr-xr-xbase/server/sbin/pkispawn40
1 files changed, 39 insertions, 1 deletions
diff --git a/base/server/sbin/pkispawn b/base/server/sbin/pkispawn
index 7c38cf9..58946aa 100755
--- a/base/server/sbin/pkispawn
+++ b/base/server/sbin/pkispawn
@@ -104,6 +104,18 @@ def main(argv):
'PKI Instance Installation and Configuration',
log.PKISPAWN_EPILOG)
+ parser.arg_parser.add_argument(
+ '--start-from',
+ dest='start_from', action='store',
+ nargs='?', metavar='<scriptlet>',
+ help='execute installation starting from the specified scriptlet')
+
+ parser.arg_parser.add_argument(
+ '--stop-at',
+ dest='stop_at', action='store',
+ nargs='?', metavar='<scriptlet>',
+ help='stop installation before the specified scriptlet')
+
parser.optional.add_argument(
'-f',
dest='user_deployment_cfg', action='store',
@@ -519,14 +531,40 @@ def main(argv):
deployer.init()
try:
+ # by default run all scriptlets from the beginning
+ run_scriptlet = True
+
+ # if starting point defined, don't run from the beginning
+ if args.start_from:
+
+ if args.start_from not in pki_subsystem_scriptlets:
+ raise Exception('Invalid starting point: %s' % args.start_from)
+
+ run_scriptlet = False
+
+ if args.stop_at and args.stop_at not in pki_subsystem_scriptlets:
+ raise Exception('Invalid stopping point: %s' % args.stop_at)
+
for scriptlet_name in pki_subsystem_scriptlets:
+ # skip the scriptlets before the starting point
+ if not run_scriptlet:
+
+ if args.start_from and args.start_from == scriptlet_name:
+ run_scriptlet = True
+
+ else:
+ continue
+
+ # if stopping point found, stop the execution
+ if args.stop_at == scriptlet_name:
+ break
+
scriptlet_module = __import__(
"pki.server.deployment.scriptlets." + scriptlet_name,
fromlist=[scriptlet_name])
scriptlet = scriptlet_module.PkiScriptlet()
-
scriptlet.spawn(deployer)
# pylint: disable=W0703