SF.net SVN: gar:[23049] csw/mgar/gar/v2/lib/python

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Wed Feb 19 11:39:59 CET 2014


Revision: 23049
          http://sourceforge.net/p/gar/code/23049
Author:   wahwah
Date:     2014-02-19 10:39:59 +0000 (Wed, 19 Feb 2014)
Log Message:
-----------
csw-upload-pkg: Update RESTful URLs in rest.py

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

Modified: csw/mgar/gar/v2/lib/python/csw_upload_pkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/csw_upload_pkg.py	2014-02-19 10:39:48 UTC (rev 23048)
+++ csw/mgar/gar/v2/lib/python/csw_upload_pkg.py	2014-02-19 10:39:59 UTC (rev 23049)
@@ -437,7 +437,6 @@
 
   username, password = rest.GetUsernameAndPassword()
   uploader = Srv4Uploader(args,
-                          options.rest_url,
                           os_release=os_release,
                           debug=options.debug,
                           username=username,

Modified: csw/mgar/gar/v2/lib/python/rest.py
===================================================================
--- csw/mgar/gar/v2/lib/python/rest.py	2014-02-19 10:39:48 UTC (rev 23048)
+++ csw/mgar/gar/v2/lib/python/rest.py	2014-02-19 10:39:59 UTC (rev 23049)
@@ -50,7 +50,7 @@
 
   def GetPkgByMd5(self, md5_sum):
     self.ValidateMd5(md5_sum)
-    url = self.releases_url + "/srv4/%s/" % md5_sum
+    url = self.pkgdb_url + "/srv4/%s/" % md5_sum
     logging.debug("GetPkgByMd5(): GET %s", url)
     try:
       data = urllib2.urlopen(url).read()
@@ -72,7 +72,7 @@
   @retry_decorator.Retry(tries=DEFAULT_TRIES, exceptions=(RestCommunicationError, httplib.BadStatusLine))
   def GetCatalogData(self, md5_sum):
     self.ValidateMd5(md5_sum)
-    url = self.rest_url + self.PKGDB_APP + "/srv4/%s/catalog-data/" % md5_sum
+    url = self.pkgdb_url "/srv4/%s/catalog-data/" % md5_sum
     try:
       data = urllib2.urlopen(url).read()
       return cjson.decode(data)
@@ -382,7 +382,7 @@
     return self._CurlPut(url, [])
 
   def GetCatalogForGeneration(self, catrel, arch, osrel):
-    url = (self.rest_url + self.PKGDB_APP + "/catalogs/%s/%s/%s/for-generation/"
+    url = (self.pkgdb_url + "/catalogs/%s/%s/%s/for-generation/"
            % (catrel, arch, osrel))
     logging.debug("GetCatalogForGeneration(): url=%r", url)
     data = urllib2.urlopen(url).read()
@@ -406,8 +406,7 @@
 
   def GetCatalogTimingInformation(self, catrel, arch, osrel):
     url = (
-      self.rest_url
-      + self.PKGDB_APP
+      self.pkgdb_url
       + "/catalogs/%s/%s/%s/timing/" % (catrel, arch, osrel))
     data = urllib2.urlopen(url).read()
     return cjson.decode(data)
@@ -451,12 +450,11 @@
     return successful, metadata
 
   def PostFile(self, filename, md5_sum):
-    if self.output_to_screen:
-      print "Uploading %s" % repr(filename)
+    logging.info("Uploading %s" % repr(filename))
     c = pycurl.Curl()
     d = StringIO()
     h = StringIO()
-    url = self.rest_url + RELEASES_APP + "/srv4/"
+    url = self.releases_url + "/srv4/"
     c.setopt(pycurl.URL, url)
     c.setopt(pycurl.POST, 1)
     c = self._SetAuth(c)

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