hard to determine valid values for power parameters

Bug #1287310 reported by James Troup
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Raphaël Badin

Bug Description

| root@mabolo:~# maas-cli root node update node-1c7c0c4c-a2cd-11e3-96c9-525400b68f5b power_parameters_power_driver="LAN_2_0 (IPMI 2.0)"
| {"power_parameters": ["Driver: Select a valid choice. LAN_2_0 (IPMI 2.0) is not one of the available choices."]}

(FWIW, I cut and paste that value from the Web UI). The error message
gives me no hint at all as what the avaiable choices are. (I
eventually figured out by looking at the source and a bit trial and
error that I was looking for 'LAN_2_0'.

This is maas 1.4+bzr1693+dfsg-0ubuntu2.2~ctools0 from the cloud-tools
pocket of the UCA on Precise.

Tags: hwe papercut

Related branches

tags: added: hwe papercut
Changed in maas:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Raphaël, this error is triggered from Django's own clean() deep inside our DictCharField.clean_sub_fields(). Do you have any ideas on how we can get it to put the list of valid choices up there?

Failing that, we need to rely on the api feature I added to get the list of available power_types on a cluster
(nodes.describe_power_types).

Revision history for this message
Raphaël Badin (rvb) wrote :

We can fix this if we customize the error message of the fields generated by make_form_field() when the field is of type ChoiceField:

http://paste.ubuntu.com/7106647/

With that fix in place, the error looks like:
$ ./bin/maas maas2 node update node-29d7ad70-4671-11e1-93b8-00225f89f211 power_parameters_power_driver="LAN_2_0yoyo"
{"power_parameters": ["Power driver: LAN_2_0yoyo is not a valid power_driver. It should be one of: LAN, LAN_2_0."]}

Raphaël Badin (rvb)
Changed in maas:
assignee: nobody → Raphaël Badin (rvb)
status: Triaged → In Progress
milestone: none → 14.04
Raphaël Badin (rvb)
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.