Merge lp:~jtv/maas/bootresources-rewrite-marker into lp:~maas-maintainers/maas/new-import-script-integration
Status: | Merged |
---|---|
Merged at revision: | 2174 |
Proposed branch: | lp:~jtv/maas/bootresources-rewrite-marker |
Merge into: | lp:~maas-maintainers/maas/new-import-script-integration |
Diff against target: |
184 lines (+102/-3) 5 files modified
etc/maas/bootresources.yaml (+15/-0) src/provisioningserver/config.py (+6/-0) src/provisioningserver/tests/test_config.py (+1/-0) src/provisioningserver/tests/test_upgrade_cluster.py (+56/-2) src/provisioningserver/upgrade_cluster.py (+24/-1) |
To merge this branch: | bzr merge lp:~jtv/maas/bootresources-rewrite-marker |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphaël Badin (community) | Approve | ||
Review via email: mp+212584@code.launchpad.net |
This proposal supersedes a proposal from 2014-03-25.
Commit message
First step towards writing a bootresources.yaml during cluster upgrade, based on locally available old-style boot images.
Description of the change
Pre-imp was with Julian. I'm keeping this to small steps, because there's going to be quite some diff and I'm messing with production filesystems here.
In this first step, I add a config item to bootresources.yaml: "configure_me" — meaning "please either edit me manually or overwrite me automatically."
The rewrite_
Our cluster upgrade mechanism requires the upgrade code to be able to tell whether it's supposed to do anything or not. And so, when the configuration is the default (which will be just fine for most users), it needs to figure out whether it is that way because that's how we believe the user wants it, or whether it's simply because nothing has been done about it yet. To that end, I added a configure_me item. After a rewrite, that item will be gone forever.
Testing this led me down some dead ends. The ConfigFixture is not suitable for patching configurations other than pserv.yaml, and attempts to fix it led right down a rabbit hole. And so I'm solving this problem ad hoc, which turns out not to be all that bad.
Jeroen
Looks good. The usage of the 'configure_me' config item is a bit messy, but I don't see a better way, and at least it's explicit.
[0]
'configure_me' is a bit vague? How about 'auto_configure _legacy' to convey the idea that this is going to be done 'automatically' by MAAS and that this is to cope with legacy installations?
[1]
16 + # If the setting is True, the upgrade procedure will look for downloaded
17 + # boot images that predate the current, Simplestreams-based import
18 + # mechanism, and rewrite the configuration based on what it finds. The new
19 + # configuration will import the new-style equivalents of the images that
20 + # were imported in the old setup.
Maybe mention that, if someone installed fresh on Trusty or up, there is no need to worry about any of this? Ideally, I'd have the packaging code remove that bit for fresh Trusty installations. I think this whole thing can be pretty confusing for users.