Update for OpenStack Train

Update snap for Train versions of the OpenStack Client and
dependencies.

Use core18 as the base for the snap.

Drop misc commands that are no longer provided.

Use python3 as the interpreter for snapcraft builds.

Switch to microstack style LXD build with switch to core18
base.

Change-Id: I2e3dc49c2ddb6889a3bf3738002d03cbc87fa644
This commit is contained in:
James Page 2019-10-08 21:28:16 +01:00
parent 36368ea91f
commit 9f6bf3426e
4 changed files with 26 additions and 13 deletions

View File

@ -1,2 +1 @@
snapcraft [platform:dpkg]
snapd [platform:dpkg]

View File

@ -1,5 +1,5 @@
name: openstackclients
version: rocky
version: train
summary: OpenStack Client tools
description: |
OpenStackClient (aka OSC) is a command-line client for OpenStack
@ -14,6 +14,7 @@ description: |
project specific command-line clients.
confinement: classic
grade: stable
base: core18
apps:
openstack:
@ -36,16 +37,12 @@ apps:
command: bin/ceilometer
cloudkitty:
command: bin/cloudkitty
designate:
command: bin/designate
freezer:
command: bin/freezer
glance:
command: bin/glance
heat:
command: bin/heat
ironic:
command: bin/ironic
magnum:
command: bin/magnum
manila:
@ -101,7 +98,8 @@ parts:
- python-openstackclient
- gnocchiclient
- python-octaviaclient
constraints: https://raw.githubusercontent.com/openstack/requirements/stable/rocky/upper-constraints.txt
constraints:
- https://raw.githubusercontent.com/openstack/requirements/stable/train/upper-constraints.txt
build-packages:
- libffi-dev
- libssl-dev
@ -113,6 +111,6 @@ parts:
snapcraftctl prime
# Now that everything is built, let's disable user site-packages
# as stated in PEP-0370
sed -i usr/lib/python3.5/site.py -e 's/^ENABLE_USER_SITE = None$/ENABLE_USER_SITE = False/'
sed -i usr/lib/python3.6/site.py -e 's/^ENABLE_USER_SITE = None$/ENABLE_USER_SITE = False/'
# This is the last step, let's now compile all our pyc files.
./usr/bin/python3 -m compileall .

16
tools/lxd_build.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
set -ex
sudo apt update
export PATH=/snap/bin:$PATH
# Setup snapd and snapcraft
sudo apt install -y snapd
sudo snap install --classic snapcraft
sudo snap install --classic lxd
sudo lxd init --auto
# Build our snap!
sudo snapcraft --use-lxd

10
tox.ini
View File

@ -3,16 +3,16 @@ envlist = snap
skipsdist = True
[testenv]
basepython = python3.5
basepython = python3
install_command = pip install {opts} {packages}
setenv =
PATH = /snap/bin:{env:PATH}
passenv = HOME TERM
whitelist_externals =
sudo
snapcraft
/snap/bin/snapcraft
[testenv:snap]
deps = -r{toxinidir}/requirements.txt
commands =
sudo snap install core
snapcraft clean
snapcraft snap
{toxinidir}/tools/lxd_build.sh