Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Retry failed apt install during bootstrap #92
Conversation
tvansteenburgh
merged commit f17be5a
into
master
Mar 22, 2017
tvansteenburgh
deleted the
bug/91-retry-apt
branch
Mar 22, 2017
|
LGTM |
johnsca
referenced this pull request
in juju/python-libjuju
Apr 6, 2017
Merged
Expanding controller.py with basic user functions, get_models and destroy #89
| + if attempt == 2: # third attempt | ||
| + raise | ||
| + sleep(5) | ||
| + else: |
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
johnsca commentedMar 22, 2017
Occasionally, apt would not be able to acquire the lock and would fail, only to succeed on the next attempt.
Fixes #91