ipsilon-client-install give password in env. var.
[cascardo/ipsilon.git] / ipsilon / install / ipsilon-client-install
index 89e6c6c..09af718 100755 (executable)
@@ -1,21 +1,6 @@
 #!/usr/bin/python
 #
-# Copyright (C) 2014  Simo Sorce <simo@redhat.com>
-#
-# see file 'COPYING' for use and warranty information
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# Copyright (C) 2014 Ipsilon project Contributors, for license see COPYING
 
 from ipsilon.tools.saml2metadata import Metadata
 from ipsilon.tools.saml2metadata import SAML2_NAMEID_MAP
@@ -130,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'])
@@ -421,14 +409,14 @@ if __name__ == '__main__':
     except Exception, e:  # pylint: disable=broad-except
         log_exception(e)
         if 'uninstall' in args and args['uninstall'] is True:
-            print 'Uninstallation aborted.'
+            logging.info('Uninstallation aborted.')
         else:
-            print 'Installation aborted.'
+            logging.info('Installation aborted.')
         out = 1
     finally:
         if out == 0:
             if 'uninstall' in args and args['uninstall'] is True:
-                print 'Uninstallation complete.'
+                logging.info('Uninstallation complete.')
             else:
-                print 'Installation complete.'
+                logging.info('Installation complete.')
     sys.exit(out)