Handling config

Evan Dandrea evan.dandrea at canonical.com
Tue Jul 5 20:13:33 UTC 2016


Hi,

Snapd does not presently have support for getting and setting individual
snap configurations. We needed to this for the Juju charm of Cassandra
<https://launchpad.net/cassandra-charm> (set `edition: apache-snap`), so
I've come up with three simple helpers:

   - config-get
   <https://github.com/evandandrea/cassandra-snap/blob/master/config-get>
   - config-set
   <https://github.com/evandandrea/cassandra-snap/blob/master/config-set>
   - env-get
   <https://github.com/evandandrea/cassandra-snap/blob/master/env-get>

These save us from having to hardcode paths in the charm. In the case of
env-get, it's useful to pull out SNAP_DATA when constructing a config file
that embeds absolute paths.

Your feedback is of course welcome, and do feel free to pull these into
your own snaps as needed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20160705/b62ea452/attachment.html>


More information about the Snapcraft mailing list