Allow multiple PXE mac addresses
MAAS allow specifying multiple pxe mac addresses for a machine during
machine creation. This commit makes it possible to specify the mac
addresses that the server may use during pxe boot as a list in the
pillar data.
To be able to pass multiple mac addresses via the API, the way of
creating the multipart message in the REST POST call had to be changed
too. The old logic took key-value pairs assuming the value is scalar.
This commit changes this logic to accept list values and in that case
create multiple message parts with the same name.
Due to alowing multiple mac addresses, the logic in the machine update
had to be changed too. The old logic checked if the new single mac
address is among the mac addresses that the host has. The new logic
checks if there is intersection between the new mac addresses and the
ones the machine has. If intersection found, that is used as new mac
addresses, and forces recreation of the machine only if no intersection
is found.
Change-Id: I9f0bb5d1654f638ad5c09ce355699c2eb37f3404
2 files changed