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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Tue Feb 18 10:40:38 CET 2014


Revision: 23040
          http://sourceforge.net/p/gar/code/23040
Author:   wahwah
Date:     2014-02-18 09:40:35 +0000 (Tue, 18 Feb 2014)
Log Message:
-----------
checkpkg: Authenticate from build hosts

When running on the build host, checkpkg needs to reach to the login host to
get the credentials.

It's ugly, but it works for now.

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-02-18 09:40:25 UTC (rev 23039)
+++ csw/mgar/gar/v2/lib/python/rest.py	2014-02-18 09:40:35 UTC (rev 23040)
@@ -19,6 +19,7 @@
 
 from lib.python import configuration
 from lib.python import errors
+from lib.python import shell
 
 
 class ArgumentError(errors.Error):
@@ -530,5 +531,15 @@
       password = af.read().strip()
   except IOError, e:
     logging.warning("Error reading %s: %s", authfile, e)
+
+  if password is None:
+    # This part is specific to OpenCSW buildfarm.
+    args = ['ssh', 'login', 'cat', authfile]
+    ret_code, stdout, stderr = shell.ShellCommand(args)
+    if not ret_code:
+      password = stdout.strip()
+
+  if password is None:
     password = getpass.getpass("{0}'s pkg release password> ".format(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