Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
clean up uniter downloads #6325
Conversation
mjs
added some commits
Sep 26, 2016
| - status := <-dl.Done() | ||
| - c.Assert(status.Err, jc.ErrorIsNil) | ||
| - | ||
| + filename, err := dl.Wait() |
| @@ -71,11 +70,12 @@ func (d *BundlesDir) download(info BundleInfo, target string, abort <-chan struc | ||
| expectedSha256, err := info.ArchiveSha256() | ||
| req := downloader.Request{ | ||
| URL: curl, | ||
| - TargetDir: d.downloadsPath(), | ||
| + TargetDir: downloadsPath(d.path), // XXX check this |
mjs
Sep 26, 2016
Contributor
To remind me to check that this was definitely correct when QAing (which I did). Removing the XXX now.
| // downloadsPath returns the path to the directory into which charms are | ||
| // downloaded. | ||
| -func (d *BundlesDir) downloadsPath() string { | ||
| - return path.Join(d.path, "downloads") | ||
| +func downloadsPath(bunsDir string) string { |
mjs
Sep 26, 2016
Contributor
To make it clear that it's supposed to receive the bundles directory. bunsDir is already used throughout this file so I was being consistent.
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit e152e58
into
juju:master
Sep 27, 2016
mjs
deleted the
mjs:1626304-clean-up-uniter-downloads
branch
Sep 27, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mjs commentedSep 26, 2016
This PR fixes https://bugs.launchpad.net/juju/+bug/1626304 for 2.0. It begins with significant refactoring of the downloads package, removing unused functionality and unnecessary complexity. This also ensure that temporary download files are always removed if downloads or download verification fails.
The second part of the PR changes the uniter worker to remove its temporary downloads directory in case files from previous failed download attempts have been left behind.
QA
Deploy a charm while running
while true; do echofind /var/lib/juju/agents/; sleep 0.05; doneon the machine. With this it was possible to see the charm's download files appear in the correct location and then moved to the correct final location.A large bundle (openstack-base) was deployed and logs were checked to ensure that charm downloads succeeded.
A unit's charm downloads directory was populated with files and the agent was restarted. The downloads directory was removed on startup.