ipsilon-client-install give password in env. var.
authorRich Megginson <rmeggins@redhat.com>
Mon, 8 Jun 2015 22:22:27 +0000 (16:22 -0600)
committerPatrick Uiterwijk <puiterwijk@redhat.com>
Tue, 9 Jun 2015 16:54:02 +0000 (18:54 +0200)
https://fedorahosted.org/ipsilon/ticket/142

If --admin-password is not given, see if the IPSILON_ADMIN_PASSWORD
environment variable is set, and use it for the admin_password, before
doing getpass().

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
ipsilon/install/ipsilon-client-install
man/ipsilon-client-install.1

index 78dfb51..09af718 100755 (executable)
@@ -115,6 +115,9 @@ def saml2():
                     logger.error("Failed to read password file!\n" +
                                  "Error: [%s]" % e)
                     raise
+        elif ('IPSILON_ADMIN_PASSWORD' in os.environ) and \
+             (os.environ['IPSILON_ADMIN_PASSWORD']):
+            admin_password = os.environ['IPSILON_ADMIN_PASSWORD']
         else:
             admin_password = getpass.getpass('%s password: ' %
                                              args['admin_user'])
index 81fdb3e..886fb48 100644 (file)
@@ -26,7 +26,7 @@ Port number that SP listens on. The default is to not set a specific listen port
 Account allowed to create a Service Provider (SP). The default is admin.
 .TP
 \fB\-\-admin\-password\fR \fIADMIN_PASSWORD\fR
-File containing the password for the account used toc reate a SP (\- to read from stdin)
+File containing the password for the account used to create a SP (\- to read from stdin).  You can also provide the password in the IPSILON_ADMIN_PASSWORD environment variable.
 .TP
 \fB\-\-httpd\-user\fR \fIHTTPD_USER\fR
 Web server account used. Some files created by the installation will be chown(1) to this user. The default is apache.