309 |
tries = 0 |
tries = 0 |
310 |
while tries < SLEEP_TIMES: |
while tries < SLEEP_TIMES: |
311 |
tries += 1 |
tries += 1 |
312 |
|
if tries > 1: time.sleep(SLEEP_REPEAT) |
313 |
try: |
try: |
314 |
# Download new tarball |
# Download new tarball |
315 |
subprocess.check_call(['mgarepo', 'sync', '-d'], cwd=self.cwd) |
subprocess.check_call(['mgarepo', 'sync', '-d'], cwd=self.cwd) |
316 |
|
# success, so exit loop |
317 |
break |
break |
318 |
except subprocess.CalledProcessError, e: |
except subprocess.CalledProcessError, e: |
319 |
# mgarepo sync returns 1 if the tarball cannot be downloaded |
# mgarepo sync returns 1 if the tarball cannot be downloaded |
320 |
if e.returncode != 1: |
if e.returncode != 1: |
321 |
return False |
return False |
322 |
|
else: |
323 |
|
return False |
324 |
|
|
|
if tries == SLEEP_TIMES: |
|
|
return False |
|
|
|
|
|
time.sleep(SLEEP_REPEAT) |
|
325 |
|
|
326 |
try: |
try: |
327 |
# Check patches still apply |
# Check patches still apply |