Commit Graph

108 Commits

Author SHA1 Message Date
Alex Kavanagh 4bf72620c3 Fix detection of already initialised lxc storage pool
The related bug was caused because the charm did not detect when
the lxc storage had already been set up using the `lxc storage`
command which is used in the 3.x series, rather than the old way
with the 2.x series.

Also fixes issue on xenial where linux-image-extra-* has been renamed to
linux-modules-extra-* from from -4.4.0-145-generic onwards.  Otherwise,
the install fails on xenial.

Change-Id: If8bdad6f5641ee21fc7860dceeb4c3facbaecc76
Closes-Bug: #1825393
2019-04-23 21:35:42 +01:00
Chris MacNaughton 47cd8e8f28 Sync charm-helpers to enable Ubuntu Disco
Change-Id: Ifebdc397e14aa67b0e5d00e1c86592b4e14b6088
2019-04-05 17:14:59 +02:00
Chris MacNaughton ade8687ad8 Sync charm-helpers for Stein release
As a part of the Stein release, we need to ensure
that charmhelpers is up to date.

Change-Id: I322710380622515e279b5f1c7cdbddfe7d7d3140
2019-04-04 10:24:06 +02:00
Ryan Beisner 2996db663f
Update pre-install hooks to fail on error
The pre-install operations may fail, yet that failure is not
elevated to the user. This masks the failure and makes early
package install issues difficult to troubleshoot.

If the basic pre-install script fails, the charm should not
proceed to later hooks as the requirements may not be met.

Hashbangs for bash should specify -e (errexit) on all of the
pre-install bash scripts.

Change-Id: I6178e2cb6665b7a4bdbe66a63b29616067932352
Closes-bug: #1815243
Partial-bug: #1815231
2019-02-08 15:52:20 -06:00
Corey Bryant 0cc0325d85 Sync charm-helpers
Change-Id: Ie4af48e8a8c44e5a5c3f90ce7ee0529ada0351c3
2019-01-11 14:37:54 +00:00
Zuul cdc86c0596 Merge "fix typos in the docstring" 2019-01-09 09:24:49 +00:00
Corey Bryant c4bc780f60 Sync charm-helpers
Change-Id: I33aea91461d6122d1c45b147544c4ab3247b21a7
2019-01-08 15:17:54 +00:00
melissaml e046a78f0b fix typos in the docstring
Change-Id: I14734341d46afc21910f468480403fbd27f10eb6
2018-12-22 03:54:25 +08:00
Ryan Beisner c2ced81ad6
Sync charm-helpers
Change-Id: I04fd37042b1510193a9b2f50c36cf97d880813cc
2018-11-07 15:34:52 -06:00
David Ames 8692aa9fb6 Series Upgrade
Implement the series-upgrade feature allowing to move between Ubuntu
series.

Change-Id: I9efe27463471fdc99f794931ee03db0bd1e06fbd
2018-10-23 10:26:19 -07:00
Zuul 01eeeff851 Merge "Sync charm helpers and enable rocky func test" 2018-09-20 15:00:00 +00:00
Ryan Beisner 72ada2bc20 Sync charm helpers and enable rocky func test
Change-Id: I898b4f28f8b65a7ba3b244ca6d0e27405a4e9ac5
2018-09-20 12:28:01 +02:00
Ryan Beisner b31cbb9ef5 Add cosmic
Add a tactical change which is already merged into charm-helpers.

This needs to go into all charms to solve the chicken:egg issue
where cosmic is untestable until this change exists.

Reference:

4835c6c167

Change-Id: I6e3ef7a281c853a04a090b931562e8389d7b655f
2018-09-19 13:27:36 +02:00
Chris MacNaughton 4d7b3e9240 Remove old nova-compute / mysql relation and patch for nova-lxd bug
This review is modified to include a patch to resolve bug #1793137
which is due to a bug in nova-lxd where the wrong pool name (lxd) is
used with zfs if lxd is new enough that the storage.zfs_pool_name key
is missing from the config.  This is the case on bionic and snap
installed lxd.

Closes-Bug: #1713807
Related-Bug: #1793137
Change-Id: I1123d9882bdb00e9183424b363fc3d1ff25f2346
2018-09-18 14:46:58 +02:00
Zuul 50927d2961 Merge "Enable Bionic as a gate test" 2018-05-11 09:01:56 +00:00
David Ames 2a4ada192d Enable Bionic as a gate test
Change bionic test from dev to gate for 18.05.

Change-Id: I45fec42fedc69430c3dbbdc752b7301efc168a8e
2018-05-09 09:34:01 -07:00
Corey Bryant d545eb292e Don't install criu for arm64/s390x prior to artful
The criu package doesn't exist for arm64/s390x prior to artful,
causing an install hook failure. Let's not attempt to install
it when that is the case.

Change-Id: If0cc517d9e607604e427aab385fabd8a9a193fdf
Closes-Bug: #1748235
2018-05-04 15:15:12 +00:00
James Page df6f14b335 Enable xenial/queens amulet tests
Update functional tests to support keystone v2/v3 helpers.

Enable basic xenial-queens functional gate.

Change-Id: I26d0bf1d2635388e295807ecaf6949cf63309c25
2018-02-28 14:54:16 +00:00
Ryan Beisner 7d5d65b15e Sync charm-helpers
Change-Id: I416f1a910386a5edbc868668710c509e6316117c
2018-02-21 14:09:05 -06:00
Ryan Beisner 8257e3dd30 Sync charm-helpers
Notable issues resolved:

openstack_upgrade_available() broken for swift
https://bugs.launchpad.net/charm-swift-proxy/+bug/1743847

haproxy context doesn't consider bindings
https://bugs.launchpad.net/charm-helpers/+bug/1735421

regression in haproxy check
https://bugs.launchpad.net/charm-helpers/+bug/1743287

Change-Id: Ieb48079184f507e4513dde20e32b3c7051de7c04
2018-01-19 12:09:20 +00:00
Ryan Beisner e06c233628 Sync charm-helpers
Change-Id: I2d870a1683ea5fdbebc4d8834c23812f90ce311e
2017-11-27 11:33:06 +00:00
Liam Young efd2dbcdd0 Install python-apt before hooks run
Previously this charm had relied on python-apt being installed by
the principle. As charms migrate to py3 this is no longer a safe
assumption and actually never was. This change ensures that
python-apt is installed before immediatly. This follows the same
pattern

Change-Id: I21ca95a9f2e410a52a7b64c99fad85749d52473a
2017-11-27 09:00:36 +00:00
Andrew McLeod c6ae48be4a Enable xenial-pike amulet test
Make default func27-smoke xenial-pike
Charm-helpers sync

Change-Id: I2af5a7bdcb956889f9e7140e67ec51a969eee379
2017-11-18 13:21:37 +13:00
Ryan Beisner f6398d7d65 Sync charm-helpers
Change-Id: I9e8e57dbc759aeda46888313fe2ab3cf973e28ed
2017-08-24 16:55:35 -05:00
Jenkins 01f46a4356 Merge "Migrate to LXD storage pools" 2017-07-05 08:33:05 +00:00
Chris MacNaughton 6df877339c Migrate to LXD storage pools
We need to continue with the previous style of managing storage
until zesty or a specified -updates channel LXD

This additionally reinforces our suggested deployment with ZFS
for a deployment, rather than using LVM as the defualt in
testing.

Closes-Bug: 1676742
Related-Bug: 1573681
Depends-On: I5c38766c4be66d63ef4a07eccc780fcab5973d49
Change-Id: I3ddbd11382c34ff9200e721fa3c90fe67bdce534
2017-07-04 13:37:30 +02:00
Alex Kavanagh 62860678f4 Fix alphanumeric comparisons for openstack and ubuntu releases
- sync charmhelpers with fix-alpha helpers
- fix up code where the alpha comparisons are done

Change-Id: I9176ea3be01146b18888266ba53a9d37439ea492
Related-Bug: #1659575
2017-04-27 16:18:50 +01:00
James Page 8a7e9753c5 Guard calls which won't work from within containers
Ensure that calls to setup live migration are not made if
the charm is running from inside a LXD container, as the
calls will fail (config needs to be done on the host, not
from within the container).

Change-Id: I1633ba0ef5030b4d170bcea9d0c90a781863b168
Closes-Bug: 1633633
2017-03-30 11:46:42 +01:00
Jenkins d159358fed Merge "Enable Ocata Amulet Tests" 2017-03-22 16:17:46 +00:00
David Ames 723b09e342 Enable Ocata Amulet Tests
- Add Zesty as a supported series to metadata.yaml.
- Turn on Xenial-Ocata Amulet test definitions.
- Sync charm helpers to get Juju 2.x amulet compatibility.
- Keeping Zesty-Ocata Amulet test definitions turned off until the
  metadata.yaml changes propagate to the charm store.
- Resync tox.ini to resolve amulet test failures.

Change-Id: I3cbc8f411dc9a4cfa6187be280dc2c43be64b611
2017-03-22 11:24:33 +00:00
Chris MacNaughton 7152517848 Adhere to the readme
Currently, providing a list of devices in config will lead
to an exception, despite the readme calling that out as an
option. Instead, we will now log a message and continue
with the behavious documented in the readme.

Change-Id: Ib5a1d1a0257227e829e433bc61f64ad4cba8052e
Closes-Bug: 1673277
2017-03-16 08:35:36 +01:00
David Ames 60692dee66 Pre-release charm-helpers sync 17.02
Get each charm up to date with lp:charm-helpers for release testing.

Change-Id: I1b7e6a7281eca80ffbb042f012e0eec0c15646ec
2017-02-14 14:58:19 -08:00
James Page f0773c9952 Increase subuid/subgid range for root user
To support use of distinct subuid/subgid ranges per LXD container,
the default range for the root user must be increased to support
> 1 running container in this configuration.

Increase subuid/subgid range to support 5000 containers with distinct
ranges.  Restart LXD daemon if idmap configuration changes, to ensure
that the full range of subid's are used.

Change-Id: I8b87dad736abaffdbd7afac090429790d3b03c96
Closes-Bug: 1648056
2016-12-07 15:24:49 +00:00
Ryan Beisner ef5a16818b Update Amulet defs, series metadata and c-h sync
- Sync charm helpers if applicable.

- Fix test executable hashbags for virtualenv prep.

- Add Yakkety-Newton Amulet test definitions.

- Prep Xenial-Ocata Amulet test definitions (not yet enabled).

- Prep Zesty-Ocata Amulet test definitions (not yet enabled).

- Add Zesty charm series metadata.

- Remove Precise charm series metadata if present.

- Remove Precise Amulet test definitions if present.

- Add CS_API_TIMEOUT & CS_API_URL to tox.ini to control
  charmstore interaction in Amulet tests

- Create flavors to fix Newton+ Amulet tests.

Change-Id: I151692df2149fa0c1b882230508e9db760a277a0
2016-12-01 19:03:58 +00:00
James Page aa8f652756 Guard enablement of ext4 mounts in containers
Its not possible to enable usernamespace ext4 mounting when LXD
is being run from inside a container; leverage charm-helpers
is_container function to guard writes to the /sys filesystem.

Change-Id: Ie479dcf45cb4834308a055dde22d919830c60671
Closes-Bug: 1635659
2016-11-09 11:41:29 +00:00
James Page b9be248dc4 Revert "Disable ext4 userns when running in a container"
This reverts commit c0d0fc5041.

Change-Id: I995a77ecd8b73dc1577325dd05ccb7198df8e658
2016-10-24 19:32:52 +00:00
Chuck Short c0d0fc5041 Disable ext4 userns when running in a container
/sys is read-only when using an LXD contianer due
to lxcfs. So detect if we are running the charm inside
a container and prevent ext4 userns from being
configured.

Closes-Bug: #1635659

Change-Id: Ia0668ea473ec1e80dd8b0a1136061a430883b0ec
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2016-10-21 15:31:54 -04:00
Jenkins 15c2437038 Merge "Update amulet test definitions for Newton" 2016-10-11 01:10:02 +00:00
Ryan Beisner f4d71ccdc0 Update amulet test definitions for Newton
- Remove Precise-Icehouse Amulet test definitions if they exist.

- Add Xenial-Newton Amulet test definitions.

- Add Yakkety-Newton Amulet test definitions.

- Use the percona-cluster charm in tests instead of the mysql charm.

Change-Id: I45e7fd67a0d1eed5f5279ff45e351c513229726e
2016-10-10 07:21:25 -05:00
Chuck Short 017246768e Add support for use of ext4 in containers
By default, LXD won't allow an unpriviledged container
to format and mount a block device, so although a block
device can be passed to a container, its not possible
to use it from inside the container.

Add a configuration flag to turn on support for use of
ext4 within user namespaces, allow unpriviledged LXD
containers to format and mount ext4 formatted block
devices from inside of the container.

Change-Id: I8eace1e7b7d4db14a3dc9f82080ac1b0ca29e892
2016-10-06 11:03:22 +01:00
David Ames 7737169846 Pre-release charm-helpers sync 16.10
Get each charm up to date with lp:charm-helpers for release testing.

Change-Id: Iabac8b8a886e8721a96cb06c13de15dd63f362c1
2016-09-30 09:06:08 -07:00
James Page b48bf6c604 Add support for application version
Juju 2.0 provides support for display of the version of
an application deployed by a charm in juju status.

Insert the application_version_set function into the
existing assess_status function - this gets called after
all hook executions, and periodically after that, so any
changes in package versions due to normal system updates
will also be reflected in the status output.

This review also includes a resync of charm-helpers to
pickup hookenv support for this feature.

Change-Id: Iecfdb372e21d1e23cefaa5f972008fc34d65b143
2016-09-21 10:30:19 +01:00
Liam Young 5bfe133362 Pre 1607 release charm-helpers sync
Sync charmhelpers to pick up bug fixes for 1607 release

Change-Id: I416986b04b84dcd4334f83dce623adb678b70370
2016-07-21 14:25:05 +00:00
David Ames 70d0ed2cf9 Pre-release charm-helpers sync
To begin release testing get each charm up to date with lp:charm-helpers

Change-Id: Ie7f11bf40fd0910c1d1332463def6274417d2462
2016-07-15 10:58:09 -07:00
Jenkins 887e006c14 Merge "Install and configure needed kernel modules" 2016-07-07 08:53:10 +00:00
James Page 980f8179f2 Resync charmhelpers for licensing change
The charm-helpers project have re-licensed to Apache 2.0
inline with the agreed licensing approach to intefaces,
layers and charms generally.

Resync helpers to bring charmhelpers inline with charm
codebase.

Change-Id: Idf85c8e79caa47182e858c6a840f714a4c371806
2016-07-06 16:35:41 +01:00
James Page 4698744a59 Re-license charm as Apache-2.0
All contributions to this charm where made under Canonical
copyright; switch to Apache-2.0 license as agreed so we
can move forward with official project status.

Change-Id: I2ae8c26a2a486ac39ee386d2c0ff96ef186edf86
2016-07-01 17:30:16 +01:00
Chuck Short b60c0183d1 Install and configure needed kernel modules
CRIU needs to load the netlink_diag kernel modules
in order for live-migration to work.

In xenial the kernel module is located in
linux-image-extra-`uname -r` debian package.
However in yakkety and newer kernels its found
in the regular linux kernel package.

So install the needed debian packages and modprobe
the module.

Change-Id: Ic2863472bb65507e4f033926b92c70a22a6724da
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2016-06-28 11:24:32 -04:00
Chuck Short 994b52de3f Switch to using charm-store for amulet tests
All OpenStack charms are now directly published to the charm store
on landing; switch Amulet helper to resolve charms using the
charm store rather than bzr branches, removing the lag between
charm changes landing and being available for other charms to
use for testing.

This is also important for new layered charms where the charm must
be build and published prior to being consumable.

Change-Id: I1bcb20ab061fa639cc1116d2fe0bbf4c5a4464bc
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2016-06-27 13:49:33 +00:00
James Page 534017af7f Resync charm-helpers
Avoid use of 'service --status-all' which is currently
broken on trusty for upstart managed daemons; the change
moves to detecting how the daemon is managed, and then
using upstart status XXX or the return code of service XXX
status to determine whether a process is running.

Fixes for IPv6 network address detection under Ubuntu
16.04 which changes the output format of the ip commands
slightly.

Update the version map to include 8.1.x as a Neutron
version for Mitaka.

Change-Id: I3290a1e2f3886e02f606002612c83750cfd6de20
Closes-Bug: 1581171
Closes-Bug: 1581598
Closes-Bug: 1580674
2016-05-18 14:06:42 +01:00