Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Self cleanup on stop hook #20
Conversation
chuckbutler
referenced this pull request
Oct 19, 2016
Closed
juju remove-application cleanup not complete #19
|
|
| + try: | ||
| + subprocess.check_call(down) | ||
| + subprocess.check_call(delete) | ||
| + except subprocess.CalledProcessError: |
Cynerva
Oct 19, 2016
Contributor
If we're going to ignore this exception here, can we at least log it for troubleshooting purposes?
| for f in files: | ||
| if os.path.exists(f): | ||
| + hookenv.log('Removing {}'.format(f)) | ||
| os.remove(f) |
mbruzek
Oct 19, 2016
Contributor
Should we do this os.remove in a try/except to soldier on if we got a file we can not delete (for example if it was in use at the time of delete attempt)?
|
I am +1 to attempting to clean up after ourselves on the stop hook. My one comment was to handle exceptions when deleting files. |
mbruzek
merged commit 30c6d75
into
juju-solutions:master
Oct 19, 2016
|
It's a good comment. I filed #21 to track that comment as the code has landed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
chuckbutler commentedOct 19, 2016
This code path bloats the teardown time by about 20 seconds, but
successfully cleans up the interface and the associated files upon
executing the stop hook