Merge lp:~blake-rouse/maas/node-effective-license-key into lp:~maas-committers/maas/trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Blake Rouse | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 2486 | ||||
Proposed branch: | lp:~blake-rouse/maas/node-effective-license-key | ||||
Merge into: | lp:~maas-committers/maas/trunk | ||||
Prerequisite: | lp:~blake-rouse/maas/global-licensekey-model | ||||
Diff against target: |
105 lines (+48/-1) 4 files modified
src/maasserver/models/node.py (+27/-0) src/maasserver/models/tests/test_node.py (+19/-0) src/maasserver/preseed.py (+1/-0) src/maasserver/tests/test_preseed.py (+1/-1) |
||||
To merge this branch: | bzr merge lp:~blake-rouse/maas/node-effective-license-key | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | Approve | ||
Review via email: mp+224354@code.launchpad.net |
Commit message
Adds the effective license key into the node context for the preseed. Allows preseed templates to access the effective license key .
Description of the change
This is the second part of a series of changes to allow a global registry of license key's in MAAS. The end result will allow a user to set a license key for each operating system and series globally. When a booting operating system and series requires a license key, first the node will be check to see if a specific key has been set in the license_key field. If not then this LicenseKey model will be used to see if one is set globally for the selected operating system and series.
This branch includes the logic to return the correct license key for the preseed. get_effective_
Short and sweet. The explanation of what it means to get an "effective" licence key would go nicely in the docstring for get_effectivel_ license_ key.
Out of interest, why the calls to both LicenseKey. objects. has_license_ key and LicenseKey. objects. get_license_ key? Depending on the semantics, they sound a bit as if the combination is effectively one operation on LicenseKey.objects.