From: Hasan Wan Date: Mon, 4 Nov 2013 07:48:18 +0000 (+0200) Subject: retry the obs operation when get ObsError X-Git-Tag: 0.15~66 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73940fba87a5b3d642e396555efc50aee5762796;p=services%2Fjenkins-scripts.git retry the obs operation when get ObsError Fixes: #1103 Change-Id: I68d5935133b94167456a2d81bc747bdaa5e14342 Signed-off-by: Hasan Wan --- diff --git a/common/buildservice.py b/common/buildservice.py index df66b83..1debc4c 100644 --- a/common/buildservice.py +++ b/common/buildservice.py @@ -31,6 +31,8 @@ from gitbuildsys.errors import ObsError from gitbuildsys.oscapi import OSC from gitbuildsys.utils import Temp +from common.utils import retry + from osc import conf, core @@ -220,6 +222,15 @@ class BuildService(OSC): # the result, in unicode string return reqinfo + @retry() + def exists(self, prj, pkg=''): + """ Overwrite the exists function with retry decorator + """ + try: + return super(BuildService, self).exists(prj, pkg) + except ObsError + return False + def get_request_list(self, dst_prj, dst_pkg, user='', req_type='', \ req_state=()): """Get already existing request list to the same obs project