Skip to content

Commit 190ab22

Browse files
committed
Stop retry loop on success
1 parent 55b6388 commit 190ab22

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

obs_maven/repo.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def parse_primary(self):
6060
logging.debug("Parsing primary %s", primary_url)
6161
for cnt in range(1, 4):
6262
try:
63+
logging.debug("Getting primary try %s", cnt)
6364

6465
# Download the primary.xml.gz to a file first to avoid
6566
# connection resets
@@ -82,9 +83,9 @@ def parse_primary(self):
8283
input_source.setByteStream(gzip_fd)
8384
parser.parse(input_source)
8485
self._rpms = handler.rpms.values()
85-
except:
86+
break
87+
except OSError:
8688
if cnt < 3:
87-
logging.debug("Getting primary try {}".format(cnt + 1))
8889
time.sleep(2)
8990
else:
9091
raise

0 commit comments

Comments
 (0)