Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add import command #20
Conversation
babbageclunk
added some commits
Aug 22, 2017
axw
reviewed
Aug 30, 2017
LGTM overall, but the storage pool filtering looks fishy. Is that needed? Why?
| @@ -94,14 +96,29 @@ def save_rollback_info(): | ||
| shutil.copy(agent_conf, backup_path) | ||
| def find_new_tools(): | ||
| - dirs = [name for name in os.listdir(UPGRADE_DIR) if path.isdir(path.join(UPGRADE_DIR, name))] | ||
| + dirs = [name for name in os.listdir(UPGRADE_DIR) if path.join(UPGRADE_DIR, name).endswith('.tgz')] |
babbageclunk
Aug 30, 2017
Member
This is a holdover from the tools originally being pushed out unpacked and moved into place as directories - I'll change it.
| + reader, _, err := store.Get(ch.StoragePath()) | ||
| + if err != nil { | ||
| + return errors.Trace(err) | ||
| + } |
| @@ -1640,6 +1655,10 @@ func (e *exporter) storagePools() error { | ||
| return errors.Annotate(err, "listing pools") | ||
| } | ||
| for _, cfg := range poolConfigs { | ||
| + if e.model.Config()["type"].(string) != "ec2" && cfg.Name() == "ebs-ssd" { |
axw
Aug 30, 2017
Member
I don't understand why you would filter out ebs-ssd specifically. What's special about it?
babbageclunk
Aug 30, 2017
Member
In 1.25 the settings are created when the ebs provider is registered, even though this is a MAAS environment. Trying to import it into the 2.2.3 target fails because the provider isn't registered in 2 anymore (there was a change at some point to stop the automatic creation of the settings). I'm not sure this is the right way to handle it, but I think we do need to filter it out somehow.
babbageclunk commentedAug 30, 2017
This exports the 1.25 environment into the 2.2.3 description, updates the tools for machines and units in the exported model, then imports the model on the target controller. It also uploads tools and charms.
There will be a separate command to activate the imported model once the agents have been upgraded (and checked that they can connect to the model).