[csw-devel] SF.net SVN: gar:[20007] csw/mgar/gar/v2/lib/python/csw_upload_pkg.py

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Wed Jan 2 10:43:59 CET 2013


Revision: 20007
          http://gar.svn.sourceforge.net/gar/?rev=20007&view=rev
Author:   dmichelsen
Date:     2013-01-02 09:43:59 +0000 (Wed, 02 Jan 2013)
Log Message:
-----------
mGAR v2: Allow csw-upload-pkg on packages not being in any catalog

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

Modified: csw/mgar/gar/v2/lib/python/csw_upload_pkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/csw_upload_pkg.py	2013-01-02 09:32:04 UTC (rev 20006)
+++ csw/mgar/gar/v2/lib/python/csw_upload_pkg.py	2013-01-02 09:43:59 UTC (rev 20007)
@@ -22,8 +22,8 @@
 import file_set_checker
 import sys
 import getpass
+import urllib2
 
-
 BASE_URL = "http://buildfarm.opencsw.org"
 RELEASES_APP = "/releases"
 DEFAULT_CATREL = "unstable"
@@ -240,8 +240,11 @@
       for osrel in osrels:
         logging.debug("%s %s %s", catrel, arch, osrel)
         cat_key = (catrel, arch, osrel)
-        srv4_in_catalog = self._rest_client.Srv4ByCatalogAndCatalogname(
-            catrel, arch, osrel, catalogname)
+        try:
+          srv4_in_catalog = self._rest_client.Srv4ByCatalogAndCatalogname(
+              catrel, arch, osrel, catalogname)
+        except urllib2.HTTPError, e:
+          srv4_in_catalog = None
         if srv4_in_catalog:
           logging.debug("Catalog %s %s contains version %s of the %s package",
                         arch, osrel, srv4_in_catalog["osrel"], catalogname)

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