Retry failed apt install during bootstrap #92

Merged
merged 1 commit into from Mar 22, 2017

Conversation

Projects
None yet
4 participants
Owner

johnsca commented Mar 22, 2017

Occasionally, apt would not be able to acquire the lock and would fail, only to succeed on the next attempt.

Fixes #91

Retry failed apt install during bootstrap
Occasionally, apt would not be able to acquire the lock and would fail,
only to succeed on the next attempt.

Fixes #91

@tvansteenburgh tvansteenburgh merged commit f17be5a into master Mar 22, 2017

@tvansteenburgh tvansteenburgh deleted the bug/91-retry-apt branch Mar 22, 2017

Owner

marcoceppi commented Mar 22, 2017

LGTM 👍

+ if attempt == 2: # third attempt
+ raise
+ sleep(5)
+ else:
@mbruzek

mbruzek Apr 7, 2017

Contributor

Is it just me or is this else not at the right indentation level?

@johnsca

johnsca Apr 7, 2017

Owner

I answered this via other channels, but for posterity:

The else here is on the try / except block, and will be executed if there are no exceptions raised. It is almost the same thing as putting the break inside the try block except that exceptions raised in the else block are not caught by any except blocks (though in this case, break can't raise a CalledProcessError anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment