obs.py: Raise RepaException instead of ObsError
authorEd Bartosh <eduard.bartosh@intel.com>
Mon, 17 Mar 2014 14:51:16 +0000 (16:51 +0200)
committerEduard Bartosh <eduard.bartosh@intel.com>
Tue, 18 Mar 2014 12:56:04 +0000 (14:56 +0200)
It's better to raise RepaException as it is caught in main.py and error
is printed on stderr. ObsError produces ugly python traceback and scares
users.

References: #1687

Change-Id: Iea85eb263c7e4010df1fa50bf6e16da1ef7f1af0
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/10673
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
repa/obs.py

index a4f74136b98b4e0865eab5a26adf45beaf3358a3..4941cbf1837c27daf6c4be4f5c4d4de9ba319c67 100644 (file)
@@ -42,7 +42,7 @@ from StringIO import StringIO
 
 from osc import core
 
-from gitbuildsys.oscapi import OSC, ObsError, OSCError
+from gitbuildsys.oscapi import OSC, OSCError
 from gitbuildsys.utils import Temp
 
 from repa.common import RepaException
@@ -151,8 +151,8 @@ class OBS(OSC):
             try:
                 answer = self.core_http(core.http_GET, url)
             except OSCError, err:
-                raise ObsError("cat't query source %s from project %s: %s" % \
-                               (package, src_project, err))
+                raise RepaException("cat't query source %s from "
+                       "project %s: %s" % (package, src_project, err))
             rev = ET.parse(answer).getroot().get('rev')
         return core.create_submit_request(self.apiurl, src_project, package,
                                           dst_project, package, message=message,