From 4d17150d924e3604110ac605c8b266aef7ace89a Mon Sep 17 00:00:00 2001 From: hyokeun Date: Wed, 13 Sep 2017 15:02:32 +0900 Subject: [PATCH] TPE-323 Retry get OBS description if failed This function only used for pre-release. Change-Id: I3bde806c952183ef3aeecbcd345a3848079da609 --- common/buildservice.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/common/buildservice.py b/common/buildservice.py index 6b438a4..6bad21a 100644 --- a/common/buildservice.py +++ b/common/buildservice.py @@ -726,12 +726,14 @@ class BuildService(OSC): def get_info(self, prj, pkg=None): """Get info dictionary, saved in description.""" - description = self.get_description(prj, pkg) - if not description: return {} - try: - return json.loads(description) - except ValueError: - return {} + for count in (1, 2, 3): + description = self.get_description(prj, pkg) + if not description: continue + try: + return json.loads(description) + except ValueError: + continue + return {} def cleanup(self, obs_project, msg): """Remove prerelease OBS project.""" -- 2.7.4