multiline strings in gadget.yaml defaults are mangled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Expired
|
Undecided
|
Unassigned |
Bug Description
Expected behavior
Multiline strings for default configurations should be passed to the snap's configure hook with actual line breaks.
Actual behavior
Line breaks are passed as “\n” literals.
Context
I'm building an appliance image for the Raspberry Pi with a custom gadget snap. This snap contains default configuration for the mir-kiosk snap. The problematic config item is “display-config”: https:/
mir-kiosk allows injecting a complete display configuration file through this configuration item: https:/
If I place a file with the desired miral-kiosk.display in my Core user directory and run `snap set mir-kiosk display-
But when I create an image with ubuntu-image and my gadget snap, the initialization process errors during the configure hook for mir-kiosk:
2019-03-
I can't inspect that file as it's instantly erased by snapd's rollback, but when I put my gadget.yaml source into a YAML parser like http://
Changed in snapd: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in snapd: | |
importance: | Medium → Undecided |
Have you tried with "|" to denote multiline string in the defaults section, e.g.
yoursnap:
multiline: |
foo
bar
This works in my limited unit test (I haven't tested it end-to-end though) and gives me a string with line breaks preserved (which is then fed internally to the config/hooks subsystem).
If that doesn't work, please provide the exact gadget.yaml you're using - the one you linked to if from your master branch, so it has changed already and doesn't reflect the description of the bug. If possible pastebin the complete file; even better would be a snap that exhibits the problem, so I can check it end-to-end.