Actions
Bug #20348
closedHammer Does Not Consistently Escape Quotes When Assigning JSON To A Host Parameter.
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Marek
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1466059
Description of problem:
When attempting to update a host, like so:
# hammer -u username host update --name testserver.example.com --parameters diskinfo2='[{"group": "apache", "pciid": 160, "fstype": "ext4", "mntopts": "", "owner": "root", "path": "/mount/point/1", "fmtopts": "", "scsiid": 1, "size": 75}, {"group": "apache", "pciid": 160, "fstype": "xfs", "mntopts": "", "owner": "apache", "path": "/mount/point/2", "fmtopts": "", "scsiid": 2, "size": 200}]'
...the host parameter "diskinfo2" is set to:
["{\"group\": \"apache", "pciid\": 160", "fstype\": \"ext4", "mntopts\": ", "owner\": \"root", "path\": \"/mount/point/1", "fmtopts\": ", "scsiid\": 1", "size\": 75}", "{\"group\": \"apache", "pciid\": 160", "fstype\": \"xfs", "mntopts\": ", "owner\": \"apache", "path\": \"/mount/point/2", "fmtopts\": ", "scsiid\": 2", "size\": 200}"]
(Note the inconsistently escaped quotes, like "size\" instead of \"size\".)
The issue is in 'KeyValueList' option normalizer that wrongly splits the key-value pairs.
Actions