Merge lp:~ltrager/maas/lp1636858 into lp:~maas-committers/maas/trunk
Proposed by
Lee Trager
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Lee Trager | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 5516 | ||||
Proposed branch: | lp:~ltrager/maas/lp1636858 | ||||
Merge into: | lp:~maas-committers/maas/trunk | ||||
Diff against target: |
72 lines (+27/-6) 3 files modified
src/maasserver/api/tests/test_machines.py (+18/-1) src/maasserver/forms.py (+8/-4) src/provisioningserver/templates/commissioning-user-data/snippets/maas_enlist.sh (+1/-1) |
||||
To merge this branch: | bzr merge lp:~ltrager/maas/lp1636858 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Blake Rouse (community) | Approve | ||
Review via email: mp+309392@code.launchpad.net |
Commit message
If the power_parameters are the empty string set them to an empty dictionary, don't use json.loads
Description of the change
When power parameters are sent over the API they are converted into a dictionary using json.loads. If an empty thing is sent json.loads fails. The MAAS client sends data as a multipart form which sends data as a base64 encoded string. When using this process the empty string becomes the None type which MAAS can currently handle. When sending the data as a URL encoded form(as the enlistment script does with curl) the empty string stays the empty string which causes a 400 error.
To post a comment you must log in.
This should not set it to "manual". It should be unset which is very different then "manual". "manual" is an actual power type, but we want the user to be promoted to select a power type, this only happens when the power type is not set at all.