snap commands need a machine readable output format

Bug #1691260 reported by Charles Butler
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
snapd
Expired
Medium
Unassigned

Bug Description

for a good while, I've been using snaps with juju charms. One of the pain points has been the lack of machine readable output for information being emitted from commands like:

snap list
snap info

Instead of getting json/yaml everything appears to be centered around human interaction with smart output formatting. Which is great until a change happens when you're attempting to capture smart output and parse it.

Take the example of the etcd snap version parser which broke this morning:

https://github.com/juju-solutions/layer-etcd/commit/d16319981b4d296095657370a99fab4a7aac4de9

We knew walking into this that there was a good chance our scraping would break if the output changed at all using things like spaces to split output. Our fear was realized.

This can be easily mitigated by providing machine friendly output formats. I would prefer JSON as it's a more dense, and flexible format than YAML, but either would suffice for situations where we're driving snapd and need to surface information from the system.

summary: - snap info needs a machine readable output format
+ snap commands need a machine readable output format
Revision history for this message
George Kraft (cynerva) wrote :

I'd like to see machine readable output as well. We're building automation that needs to do validation around snap versions and I'm concerned the output of `snap list` will change in unpredictable ways.

Michael Vogt (mvo)
Changed in snapd:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Can you use the REST API instead of running the CLI and parsing the output?

Changed in snapd:
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for snapd because there has been no activity for 60 days.]

Changed in snapd:
status: Incomplete → Expired
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.