Merge lp:~jtv/maas/bug-1084507 into lp:~maas-committers/maas/trunk
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1391 |
Proposed branch: | lp:~jtv/maas/bug-1084507 |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
143 lines (+41/-3) 4 files modified
src/maasserver/api.py (+15/-1) src/maasserver/tests/test_api.py (+16/-2) src/provisioningserver/tests/test_tftp.py (+5/-0) src/provisioningserver/tftp.py (+5/-0) |
To merge this branch: | bzr merge lp:~jtv/maas/bug-1084507 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphaël Badin (community) | Needs Information | ||
Julian Edwards (community) | Approve | ||
Review via email: mp+137755@code.launchpad.net |
Commit message
Pass cluster uuid to pxeconfig API call, so it knows which cluster a request comes from.
Description of the change
The pxeconfig call used to figure out which cluster it should write a config for by inspecting the requesting IP address. That won't work in the general case because the request is (now) made by the cluster controller, from an IP address that isn't on any cluster-managed network interface.
Discussed this with Julian. We really want to avoid dragging celery config into the tftpd process, but that's where we keep a cluster's uuid at the moment. The plan is to move that into maas_cluster.conf, but in a separate branch. It's nontrivial yak-shaving. This does mean that this branch by itself won't solve the problem for cluster controllers that aren't running on the region controller: by default, the process will still read the default celery config rather than the one we manage for cluster controllers. Setting the right environment variable in the pserv startup job might fix that, but we're planning to go with the "nicer" fix.
Jeroen
This wasn't *quite* what I had in mind in our pre-imp, but it's a reasonable start. I was hoping that you'd fix the pserv so it gets the UUID value from a new (duplicate) location in the /etc/maas/ maas_cluster. conf file, and then clean up the *duplication* later.
8 +def find_cluster_ for_pxeconfig_ request( request) : request)
...
15 + return find_nodegroup(
We really need to be more consistent with naming; "cluster" externally and "nodegroup" internally. In fact, cluster really refers to the whole set of processes running on that edifice, whereas nodegroup is the name of a model.
Therefore I'd change that function to: for_pxeconfig_ request( request)
def find_nodegroup_