Merge lp:~rvb/maas/bulk-load into lp:~maas-committers/maas/trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Raphaël Badin | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 1289 | ||||
Proposed branch: | lp:~rvb/maas/bulk-load | ||||
Merge into: | lp:~maas-committers/maas/trunk | ||||
Diff against target: |
199 lines (+117/-1) 7 files modified
src/maasserver/api.py (+3/-0) src/maasserver/models/macaddress.py (+3/-0) src/maasserver/models/managers.py (+30/-0) src/maasserver/models/node.py (+3/-1) src/maasserver/tests/models.py (+12/-0) src/maasserver/tests/test_api.py (+24/-0) src/maasserver/tests/test_managers.py (+42/-0) |
||||
To merge this branch: | bzr merge lp:~rvb/maas/bulk-load | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+130535@code.launchpad.net |
Commit message
Load the mac addresses related to a node from the cache even if .iterator() is used. Preload the macaddresses and the tags related to a list of nodes when fetching the list of nodes via the api.
Description of the change
Load the related mac addresses in bulk. Preload the macaddresses and the tags related to a list of nodes when fetching the list of nodes via the api.
= Notes =
This took some time to figure out a clean way to fix that problem but I think this solution is quite all right and does not interfere too much with the rest of the code.
I tried using [tag.name for tag in self.tags.
With that change in, a request to http://