Tools for writing OpenStack Snap packages
Go to file
Pete Vander Giessen 322514211b snap-config-keys is now a map
It maps the name of the config values that we use in our templates to
the name of the key in the snap config. This allows us to stick a
bunch of stuff in the questions namespace in the snap config, and to
use dashes, with minimal changes to our templates.

Drop Python 2 support, to fix tests.

Change-Id: I48b86b5e557e30f81e9cc415e7fa3a9133aa9f39
2019-10-07 12:58:12 -04:00
doc/source Add some basic unit tests 2016-11-21 12:29:29 +00:00
releasenotes Initial Cookiecutter Commit. 2016-11-09 16:22:37 +00:00
snap_openstack snap-config-keys is now a map 2019-10-07 12:58:12 -04:00
.coveragerc Initial Cookiecutter Commit. 2016-11-09 16:22:37 +00:00
.gitignore Fixup jinja2 loader configuration 2016-11-10 09:58:20 +00:00
.gitreview OpenDev Migration Patch 2019-04-19 19:50:19 +00:00
.mailmap Initial Cookiecutter Commit. 2016-11-09 16:22:37 +00:00
.testr.conf Initial Cookiecutter Commit. 2016-11-09 16:22:37 +00:00
babel.cfg Initial Cookiecutter Commit. 2016-11-09 16:22:37 +00:00
CONTRIBUTING.rst Initial Cookiecutter Commit. 2016-11-09 16:22:37 +00:00
HACKING.rst fix error url 2018-08-16 09:31:58 +08:00
LICENSE Initial Cookiecutter Commit. 2016-11-09 16:22:37 +00:00
MANIFEST.in Initial Cookiecutter Commit. 2016-11-09 16:22:37 +00:00
README.rst fix error url 2018-08-16 09:31:58 +08:00
requirements.txt Add locking to enable single process code execution 2017-03-22 16:40:21 +00:00
setup.cfg Baseline commit 2016-11-10 09:18:28 +00:00
setup.py Initial Cookiecutter Commit. 2016-11-09 16:22:37 +00:00
test-requirements.txt Initial Cookiecutter Commit. 2016-11-09 16:22:37 +00:00
tox.ini Add automatic setup of REQUESTS_CA_BUNDLE 2017-10-26 09:39:42 +01:00

snap.openstack

Helpers for writing Snaps for OpenStack

This project provides a wrapper for automatically wrapping openstack commands in snaps, building out appropriate Oslo configuration and logging options on the command line.

This wrapper is used by including a snap-openstack.yaml configuration file into the root of a snap.

Setup is executed for all entry points prior to execution snap-openstack will assure that templated files are in place and that any directory structure in $SNAP_COMMON is created.

setup:
  dirs:
    - "{snap_common}/etc/nova.conf.d"
    - "{snap_common}/etc/nova"
    - "{snap_common}/logs"
  templates:
    "nova-snap.conf.j2": "{snap_common}/etc/nova.conf.d/nova-snap.conf"

snap-openstack.yaml should also declare entry points for the snap:

entry_points:
  nova-manage:
    binary: nova-manage
    config-files:
      - "{snap}/etc/nova/nova.conf"
      - "{snap_common}/etc/nova/nova.conf"
    config-dirs:
      - "{snap_common}/etc/nova.conf.d"
    log-file: "{snap_common}/logs/nova-manage.log"

Executes the following:

nova-manage --config-file=$SNAP/etc/nova/nova,conf \
            --config-file=$SNAP_COMMON/etc/nova/nova.conf \
            --config-dir=$SNAP_COMMON/etc/nova.conf.d \
            --log-file=$SNAP_COMMON/logs/nova-manage.log

entry points are designed to be executed from the snapcraft.yaml apps section using:

command: snap-openstack nova-manage

any additional arguments provided will be passed to the underlying binary.

Features

  • Support for classic mode snap use