Malformed JSON in test script parameters

Bug #1843759 reported by Steve Rydz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Lee Trager

Bug Description

When adding a test script that has parameters such as the "internet-connectivity" script, the value of the parameters key is not valid JSON.

See example: https://pastebin.canonical.com/p/3CJ4bw3tbk/

In this case the single quotes should be double quotes and booleans should not be capitalised. This makes it impossible to parse on the front-end therefore preventing it from allowing the user to add to the parameters via the UI.

Related branches

Revision history for this message
Lee Trager (ltrager) wrote :

The UI should be looking at the interface field which contains the id of the interface. If one exists the the UI can map that id on the nose model.

The parameters field should not be used as it may not be current.

Changed in maas:
status: New → Incomplete
Revision history for this message
Steve Rydz (steverydz) wrote :

Sorry, I should have added the use case for this in the description. The use case is that we need to be able to supply a URL to a test script. If this isn't the way to do it what would you suggest instead?

Revision history for this message
Lee Trager (ltrager) wrote :

Apologies I misunderstood this bug, I thought this was for the ScriptResult model, not the Script model. You are correct that the websocket was incorrectly turning the parameters dictionary into a string. This has been fixed in the related branch.

Changed in maas:
status: Incomplete → In Progress
importance: Undecided → High
assignee: nobody → Lee Trager (ltrager)
Changed in maas:
milestone: none → next
status: In Progress → Fix Committed
Changed in maas:
milestone: next → 2.7.0b1
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.