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] snapd [platform:dpkg]

View File

@ -1,5 +1,5 @@
name: openstackclients name: openstackclients
version: rocky version: train
summary: OpenStack Client tools summary: OpenStack Client tools
description: | description: |
OpenStackClient (aka OSC) is a command-line client for OpenStack OpenStackClient (aka OSC) is a command-line client for OpenStack
@ -14,6 +14,7 @@ description: |
project specific command-line clients. project specific command-line clients.
confinement: classic confinement: classic
grade: stable grade: stable
base: core18
apps: apps:
openstack: openstack:
@ -36,16 +37,12 @@ apps:
command: bin/ceilometer command: bin/ceilometer
cloudkitty: cloudkitty:
command: bin/cloudkitty command: bin/cloudkitty
designate:
command: bin/designate
freezer: freezer:
command: bin/freezer command: bin/freezer
glance: glance:
command: bin/glance command: bin/glance
heat: heat:
command: bin/heat command: bin/heat
ironic:
command: bin/ironic
magnum: magnum:
command: bin/magnum command: bin/magnum
manila: manila:
@ -101,7 +98,8 @@ parts:
- python-openstackclient - python-openstackclient
- gnocchiclient - gnocchiclient
- python-octaviaclient - 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: build-packages:
- libffi-dev - libffi-dev
- libssl-dev - libssl-dev
@ -113,6 +111,6 @@ parts:
snapcraftctl prime snapcraftctl prime
# Now that everything is built, let's disable user site-packages # Now that everything is built, let's disable user site-packages
# as stated in PEP-0370 # 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. # This is the last step, let's now compile all our pyc files.
./usr/bin/python3 -m compileall . ./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 skipsdist = True
[testenv] [testenv]
basepython = python3.5 basepython = python3
install_command = pip install {opts} {packages} install_command = pip install {opts} {packages}
setenv =
PATH = /snap/bin:{env:PATH}
passenv = HOME TERM passenv = HOME TERM
whitelist_externals = whitelist_externals =
sudo sudo
snapcraft /snap/bin/snapcraft
[testenv:snap] [testenv:snap]
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt
commands = commands =
sudo snap install core {toxinidir}/tools/lxd_build.sh
snapcraft clean
snapcraft snap