SF.net SVN: gar:[23236] csw/mgar/gar/v2/lib/python/rest.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sun Mar 16 13:36:22 CET 2014


Revision: 23236
          http://sourceforge.net/p/gar/code/23236
Author:   wahwah
Date:     2014-03-16 12:36:21 +0000 (Sun, 16 Mar 2014)
Log Message:
-----------
pkgdb: Tolerate missing password file

Also don't ask the user for password. If the password is not in the
file, there's no password.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/rest.py

Modified: csw/mgar/gar/v2/lib/python/rest.py
===================================================================
--- csw/mgar/gar/v2/lib/python/rest.py	2014-03-16 12:36:12 UTC (rev 23235)
+++ csw/mgar/gar/v2/lib/python/rest.py	2014-03-16 12:36:21 UTC (rev 23236)
@@ -536,16 +536,12 @@
   if password is None:
     # This part is specific to OpenCSW buildfarm.
     args = ['ssh', '-o BatchMode=yes', '-o StrictHostKeyChecking=no', 'login', 'cat', authfile]
-    ret_code, stdout, stderr = shell.ShellCommand(args)
+    ret_code, stdout, stderr = shell.ShellCommand(args, allow_error=True)
     if not ret_code:
       password = stdout.strip()
     else:
       logging.debug('Failed running %r', args)
 
-  if password is None:
-    logging.warning(
-        'Could not find password for user %r. '
-        'Falling back to getpass.getpass().', username)
-    password = getpass.getpass("{0}'s pkg release password> ".format(username))
+  logging.warning('Could not find password for user %r.', username)
 
   return username, password

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list