LP: #1847046 - MAAS doesn't detect the right PXE interface
Extract the boot interface from the kernel cmdline.
This is more reliable than relying on the PXE boot MAC, since a lot of
cases we don't have it.
There's still code that tries to guess the PXE interface when the
machine boots with UUID, but I change it to keep the current one if it's
on the same VLAN.
(cherry picked from commit 5e371015372acd7f51901235188c74b2e1c25734)
Re-raise DatabaseErrors if form_pod.save() raises an exception.
The old code tried to mark the node as failed deployment, which failed
since the transaction was broken. Further more, the transaction wouldn't
be retried, which would have make the deploy succeed.
This is a stop-gap fix that improves the situation slightly. It's made
small so tha it can be backported to 2.6. The real fix is to refactor
the processing of the messages, so that marking the node as failed or
succeeded happens in a separate transaction.
(cherry picked from commit 6df0418010f49265549dac05233bc6cdfbc177e0)
Move DeferredAttribute loading prevention to a monkeypatch.
We currently prevent DeferredAttributes from being loaded from the
database in CleanSave.__getattribute__. However, that is very expensive,
since for each attribute get, we apply this check.
As an example, in a test that gets 30 nodes using the machine.list
websocket call, this patch took it down from 1.1 seconds to 0.6 seconds.