Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Always ask controller about models to migrate. #6592
Conversation
howbazaar
changed the base branch from
staging
to
develop
Nov 22, 2016
QABootstrapped two lxd controllers, source and target |
mjs
approved these changes
Nov 22, 2016
Thanks for sorting this out. Looks good - just a couple of suggestions.
| + // with that name. | ||
| + owner := "" | ||
| + name := c.model | ||
| + if strings.Contains(name, "/") { |
| + if owner != "" && model.Owner != owner { | ||
| + continue | ||
| + } | ||
| + matches = append(matches, model) |
mjs
Nov 22, 2016
Contributor
I would have done:
if model.Name == name && (owner == "" || model.Owner == owner) {
matches = append(matches, model)
}perhaps with a helper for the owner matching part.
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
intermittent failure: $$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
howbazaar commentedNov 22, 2016
Rather than rely on the admin's locally cached info, always ask the controller about the models when determining the model uuid to migrate.