pam: use a pam object method instead of pam module function
[cascardo/ipsilon.git] / ipsilon / install / ipsilon-server-install
index 7837527..64fa413 100755 (executable)
@@ -410,7 +410,8 @@ def parse_args(plugins):
         return args
 
     if len(args['hostname'].split('.')) < 2:
-        raise ConfigurationError('Hostname: %s is not a FQDN')
+        raise ConfigurationError('Hostname: %s is not a FQDN' %
+                                 args['hostname'])
 
     for plugin_group in plugins:
         for plugin_name in plugins[plugin_group]:
@@ -420,7 +421,8 @@ def parse_args(plugins):
     try:
         pwd.getpwnam(args['system_user'])
     except KeyError:
-        raise ConfigurationError('User: %s not found on the system')
+        raise ConfigurationError('User: %s not found on the system' %
+                                 args['system_user'])
 
     if args['lm_order'] is None:
         args['lm_order'] = []
@@ -441,12 +443,12 @@ if __name__ == '__main__':
     opts = []
     out = 0
     openlogs()
+    logger.setLevel(logging.DEBUG)
+
     try:
         fplugins = find_plugins()
         opts = parse_args(fplugins)
 
-        logger.setLevel(logging.DEBUG)
-
         logger.debug('Installation arguments:')
         for k in sorted(opts.iterkeys()):
             logger.debug('%s: %s', k, opts[k])
@@ -459,7 +461,8 @@ if __name__ == '__main__':
         else:
             install(fplugins, opts)
     except Exception, e:  # pylint: disable=broad-except
-        logger.debug(e, exc_info=1)
+        logger.info(str(e))         # emit message to console
+        logger.debug(e, exc_info=1) # add backtrace information to logfile
 
         if 'uninstall' in opts and opts['uninstall'] is True:
             logger.info('Uninstallation aborted.')