[Checkins] SVN: keas.build/trunk/ - Improvement: add username and password on install to the URL that buildout gets for the .cfg file

Adam Groszer agroszer at gmail.com
Fri Oct 16 13:55:02 EDT 2009


Log message for revision 105107:
  - Improvement: add username and password on install to the URL that buildout gets for the .cfg file
    Let's hope that buildout does not leave that password around.

Changed:
  U   keas.build/trunk/CHANGES.txt
  U   keas.build/trunk/src/keas/build/install.py

-=-
Modified: keas.build/trunk/CHANGES.txt
===================================================================
--- keas.build/trunk/CHANGES.txt	2009-10-16 17:31:42 UTC (rev 105106)
+++ keas.build/trunk/CHANGES.txt	2009-10-16 17:55:01 UTC (rev 105107)
@@ -4,6 +4,10 @@
 0.1.5 (unreleased)
 ------------------
 
+- Improvement: add username and password on install to the URL that buildout
+  gets for the .cfg file
+  Let's hope that buildout does not leave that password around.
+
 - Improvement(?) or fix: remove twisted dependency that was used in deploy
   for SSH
 

Modified: keas.build/trunk/src/keas/build/install.py
===================================================================
--- keas.build/trunk/src/keas/build/install.py	2009-10-16 17:31:42 UTC (rev 105106)
+++ keas.build/trunk/src/keas/build/install.py	2009-10-16 17:55:01 UTC (rev 105107)
@@ -24,6 +24,7 @@
 import re
 import sys
 import urllib2
+import urlparse
 from keas.build import base
 
 logger = base.logger
@@ -139,11 +140,20 @@
                     print '  * ' + name
                 version = base.getInput('Version', versions[-1], False)
         # 4. Install the package
+        url = self.options.url
+
+        if self.options.username:
+            #add username and password if present so that buildout can access
+            #the URL without prompting
+            parts = urlparse.urlparse(url)
+            url = '%s://%s:%s@%s' % (parts[0], self.options.username,
+                                     self.options.password, ''.join(parts[1:]))
+
         base.do('%s -t %s -%sc %s%s/%s-%s-%s.cfg' %(
                 self.options.buildout,
                 self.options.timeout,
                 "vv" if self.options.verbose else "",
-                self.options.url,
+                url,
                 project,
                 project, variant, version),
                 captureOutput=False)



More information about the checkins mailing list