>From f49dc34baed7ed1be00393d00a40a31eb2de3211 Mon Sep 17 00:00:00 2001
From: Abhishek Koneru <akoneru@redhat.com>
Date: Thu, 4 Apr 2013 12:23:07 -0400
Subject: [PATCH] Show some more information after installing a subsystem.

Print the command to get the status of a subsystem and the URL to
access after installation.

Ticket #514
---
 base/server/src/engine/pkimessages.py |   12 ++++++++++++
 base/server/src/pkispawn              |   34 ++++++++++++++++++++++++++++++++-
 2 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/base/server/src/engine/pkimessages.py b/base/server/src/engine/pkimessages.py
index 8a3a280f32a62e14c3b7da986ba606a837e4ce2d..d5c14ec8e08c0058f4036cd8c3dbe7236d4c107e 100644
--- a/base/server/src/engine/pkimessages.py
+++ b/base/server/src/engine/pkimessages.py
@@ -53,6 +53,7 @@ PKI_VERBOSITY=\
 "  -vvv             error|warning|info|debug    error|warning|info|debug\n"\
 " "
 
+
 # PKI Deployment Error Messages
 PKI_BADZIPFILE_ERROR_1 = "zipfile.BadZipFile:  %s!"
 PKI_CONFIGURATION_RESTART_1 = "After configuration, the server can be "\
@@ -307,6 +308,17 @@ PKI_CONFIG_JAVA_CONFIGURATION_EXCEPTION =\
 PKI_CONFIG_RESPONSE_ADMIN_CERT = "adminCert:"
 PKI_CONFIG_RESPONSE_STATUS = "status:"
 PKI_CONFIG_NOT_YET_IMPLEMENTED_1 = " %s NOT YET IMPLEMENTED"
+PKI_CHECK_STATUS_MESSAGE = "\tTo check the status of the subsystem: "\
+"systemctl status pki-tomcatd\@%s.service"
+PKI_ACCESS_URL = "\tThe URL for the subsystem is https://%s:%s/%s"
+PKI_INSTANCE_RESTART_MESSAGE = "\tTo restart the subsystem: systemctl restart pki-tomcatd\@%s.service"
+
+PKI_SPAWN_INFORMATION_HEADER = "\n\t==========================================================================\n"\
+                               "\t                         INSTALLATION INFORMATION\n"\
+                               "\t==========================================================================\n"
+
+PKI_SPAWN_INFORMATION_FOOTER = "\n\t==========================================================================\n"
+
 
 # PKI Deployment "Scriptlet" Messages
 ADMIN_DOMAIN_DESTROY_1 = "depopulating '%s'"
diff --git a/base/server/src/pkispawn b/base/server/src/pkispawn
index d36de33d5bdea3893bb4c6cd350c54282816d9ae..eef38204fd65278611f0f04ed4006ff868ceca7e 100755
--- a/base/server/src/pkispawn
+++ b/base/server/src/pkispawn
@@ -376,10 +376,42 @@ def main(argv):
     config.pki_log.debug(pkilogging.format(config.pki_master_dict),
                          extra=config.PKI_INDENTATION_LEVEL_0)
 
-    print
+    print_install_information()
+
     print "Installation complete."
+    print
 
 
+def print_install_information():
+    config.pki_log.info(log.PKI_SPAWN_INFORMATION_HEADER, extra=config.PKI_INDENTATION_LEVEL_0)
+    print log.PKI_SPAWN_INFORMATION_HEADER
+
+    config.pki_log.info("\tAdmin username: %s",config.pki_master_dict['pki_admin_uid'], extra=config.PKI_INDENTATION_LEVEL_0)
+    print "\tAdmin username: %s" % config.pki_master_dict['pki_admin_uid']
+
+    config.pki_log.info("\tLocation of client database: %s",config.pki_master_dict['pki_client_database_dir'], extra=config.PKI_INDENTATION_LEVEL_0)
+    print "\tLocation of client database: %s" % config.pki_master_dict['pki_client_database_dir']
+
+    config.pki_log.info("Client certificate nickname: %s", config.pki_master_dict['pki_admin_nickname'], extra=config.PKI_INDENTATION_LEVEL_0)
+    print "\tClient certificate nickname: %s" % config.pki_master_dict['pki_admin_nickname']
+
+    config.pki_log.info(log.PKI_CHECK_STATUS_MESSAGE, config.pki_master_dict['pki_instance_name'], extra=config.PKI_INDENTATION_LEVEL_0)
+    print log.PKI_CHECK_STATUS_MESSAGE % config.pki_master_dict['pki_instance_name']
+
+    config.pki_log.info(log.PKI_INSTANCE_RESTART_MESSAGE, config.pki_master_dict['pki_instance_name'], extra=config.PKI_INDENTATION_LEVEL_0)
+    print log.PKI_INSTANCE_RESTART_MESSAGE % config.pki_master_dict['pki_instance_name']
+
+    config.pki_log.info(log.PKI_ACCESS_URL, config.pki_master_dict['pki_hostname'],
+                        config.pki_master_dict['pki_https_port'],
+                        config.pki_subsystem.lower(),
+                        extra=config.PKI_INDENTATION_LEVEL_0)
+    print log.PKI_ACCESS_URL % (config.pki_master_dict['pki_hostname'],
+                                config.pki_master_dict['pki_https_port'],
+                                config.pki_subsystem.lower())
+
+    config.pki_log.info(log.PKI_SPAWN_INFORMATION_FOOTER, extra=config.PKI_INDENTATION_LEVEL_0)
+    print log.PKI_SPAWN_INFORMATION_FOOTER
+
 # PKI Deployment Entry Point
 if __name__ == "__main__":
     signal.signal(signal.SIGINT, interrupt_handler)
-- 
1.7.10.2

