From 73940fba87a5b3d642e396555efc50aee5762796 Mon Sep 17 00:00:00 2001 From: Hasan Wan Date: Mon, 4 Nov 2013 09:48:18 +0200 Subject: [PATCH] retry the obs operation when get ObsError Fixes: #1103 Change-Id: I68d5935133b94167456a2d81bc747bdaa5e14342 Signed-off-by: Hasan Wan --- common/buildservice.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- 2.7.4