Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry failed apt install during bootstrap #92

Merged
merged 1 commit into from Mar 22, 2017
Merged

Conversation

johnsca
Copy link
Contributor

@johnsca 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

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 March 22, 2017 21:23
@marcoceppi
Copy link
Contributor

LGTM 👍

if attempt == 2: # third attempt
raise
sleep(5)
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants