10 Commits

Author SHA1 Message Date
Trent Lloyd
c9db7fe9a9 Make the GPG validation keyring configurable
Add a new configuration option custom_keyring which allows the user to
provide a custom GPG keyring for validating the simplestreams source,
instead of the default /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg

Change-Id: Ib564a6e259274a076675687a03c0c2030d35e221
2024-10-04 08:20:04 +00:00
Hervé Beraud
e80b2b6b2b Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Note that https://github.com/openstack/charms.openstack is used during tests
and he need `mock`, unfortunatelly it doesn't declare `mock` in its
requirements so it retrieve mock from other charm project (cross dependency).
So we depend on charms.openstack first and when
Ib1ed5b598a52375e29e247db9ab4786df5b6d142 will be merged then CI
will pass without errors.

Depends-On: Ib1ed5b598a52375e29e247db9ab4786df5b6d142
Change-Id: I57ef29855eefd0f8dc40cc427eb9bfc8796032e3
2021-12-15 10:22:52 +00:00
Yoshi Kadokawa
bf23ef75b2 Add support for juju resources
Simplestreams package is now installed via snap. By having the juju
resources for the snap package, it can benefit in offline environment.

Closes-Bug: 1921832
Change-Id: I5f21ca9faff35427281076e142942c3458e71091
2021-10-05 06:04:44 +00:00
James Page
bfddde02ac Ensure all config files written on config-changed
Write all configuration files when charm configuration options
change to ensure that the ssl_ca is written into the identity.yaml
file.

This commit also drops some parts of the unit tests for hooks
which to be honest need reworking as they have a number of
boundary violations.

Change-Id: I5e84ebd23fd487f64b2902327ce3f33739ed9840
Closes-Bug: 1843484
2020-07-23 07:10:18 +01:00
James Page
2dfcecf8d2 Ensure ssl_ca is always installed to system certs
If an encoded SSL CA cert is provided via configuration ensure
it is installed to the system certificate store.

Change-Id: I58f4b89996dc734c4253c2bc2237616434c8143c
Closes-Bug: 1851474
2020-06-18 16:19:57 +01:00
James Page
fd3d2b7610 Switch to using snap for simplestreams tools
Switch over to using the new simplestreams snap instead of using
the largely unmaintained packaging in distro (and various PPA's).

This drops direct integration with the simplestreams codebase
in preference to just calling the sstream-mirror-glance command
with the correct parameters.

This commit includes refactoring of 'custom_properties' handling
which was actually broken - there was no loading of the yaml
formatted list, which was probably overkill, so the option now
takes a space separated list of key=value pairs, for example:

 custom_properties="hw_firmware_type=uefi hw_vif_multiqueue_enabled=true"

Fix version comparison in script wrapper.

Drop Trusty support - snaps on Trusty are awkward requiring new
kernel versions and trusty support was only retained for upgrade
purposes anyway.

Drop unsupported Xenial OpenStack versions.

Fixup CA cert handling to use any charm installed CA cert (including
that provided via the certificates relation) and install cert
to snap compatible location for simplestreams to use.

Add basic action to perform image sync on demand an refactor
the glance simplestreams sync wrapper to work within a hook
context to support the action.

Disable automatic scheduling of image syncs by default as this
tends to be racey during deployment resulting in images being
synced to glance unit local storage.

Add bionic-ussuri bundle and make it the default smoke test.

Deprecate source and key options - no longer required for
deployment with snap.

Change-Id: I730df6b7f5955ddfeea5b8de15490ac083823f5a
Func-Test-PR: https://github.com/openstack-charmers/zaza-openstack-tests/pull/321
2020-06-18 08:50:02 +01:00
Jacek Nykis
0bf193dc85 Add custom_properties config option
This change add "custom_properties" configuration option which
allows custom image properties to be added to glance.

Change-Id: I32d97c9f8026ac1aa16a2bc6cd134f26860c59b2
Closes-Bug: #1783125
2019-12-02 10:34:02 -08:00
Alex Kavanagh
6aa32f2d67 Migrate charm to Python3
Change-Id: Ibb46dfa766b12aedea90f823d3964c569bdfcb01
2019-02-04 19:18:02 +00:00
James Page
3d9ed6003f Resync charmhelpers for fixes to add_source
Closes-Bug: 1370933
2017-04-10 09:25:48 +01:00
James Page
6cc0f9dc88 Initial baseline from bzr 2017-04-10 09:00:27 +01:00