Commit Graph

32 Commits

Author SHA1 Message Date
Hervé Beraud 7d3ea76ca8 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: I991fa5afc63c09fcb3f0982c08c815d5561b7f07
2021-12-15 10:15:54 +00:00
Zuul c8ceb21bf9 Merge "Add Ceph BlueStore Compression support" 2020-10-07 13:18:01 +00:00
Frode Nordahl d8eb737046
Add Ceph BlueStore Compression support
Ceph Bluestore Compression is a post-deploy configurable option
and allowing to update the broker request is required. Drop code
that gates the sending of pool broker request, the original issue
has been fixed in the interface code and it is now safe to call
multiple times.

Unpin flake8, fix minor lints.

Change-Id: Ib8a209fffddc882c4b42a620f284a0d0504a749f
2020-10-06 13:18:07 +02:00
Alex Kavanagh bedc0d7a8d Sync libraries & common files prior to freeze
* charm-helpers sync for classic charms
* charms.ceph sync for ceph charms
* rebuild for reactive charms
* sync tox.ini files as needed
* sync requirements.txt files to sync to standard

Change-Id: Icf6ef2ae4b845f4dc612a5d949144eb5c11030b1
2020-09-28 10:17:48 +01:00
Aurelien Lourot 0ee741575c Fix storage-ceph-relation-joined error
TypeError: 'str' object is not callable
After recent interface change

Change-Id: I794224b5d0750e100cdb62d1b03140b87e117ea8
Closes-Bug: #1893445
2020-08-29 12:53:04 +02:00
Alex Kavanagh 88e450a6bb Stop charm running handlers during update-status
The update-status hook is supposed to be lightweight; prior to this
change the charm was running all of the handlers including a no-op
checking for upgrades to openstack.  This patchset builds on the
depends-on patchset and gates the update-status hook against those
handlers.  Note that update-status is handled using the default handler.

Depends-On: I7ca97db646ada95d7f5541ca4e2cf14013c0d7a6
Change-Id: I1e14e609567d00bed6e8bb755acabd08c1113469
Closes-Bug: #1824119
2020-08-20 14:19:22 +01:00
Zuul 3cd1463f90 Merge "Stop to use the __future__ module." 2020-07-13 05:31:19 +00:00
camille.rodriguez b9a5c54da8 Enable S3 storage backend for Gnocchi
This feature enables the use of a S3 storage backend for Gnocchi.

Charm specs PR: https://review.opendev.org/#/c/738631/
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/334

Change-Id: I959ed69e08b178cddf72535f22499a66b24f9567
2020-06-30 15:31:00 +00:00
Hervé Beraud 09ef0115bb Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I6258aa70918fdf3ddac7664fcdfcc02b9081463b
2020-06-02 19:42:07 +02:00
Hemanth Nakkina 901e08ea00 Fix blocked gnocchi unit due to remove/add ceph-mon relation
Removing and adding back ceph-mon relation to gnocchi unit, the unit becomes
blocked. Since the flag ceph.create_pool.req.sent is already set, its not
triggered during subsequent add of ceph-mon relation. This makes the relation
inactive.

This patch resets the flag ceph.create_pool.req.sent based on the flags that
will be reset at ceph-client interface when relation is broken.

Change-Id: I3a1f4a0fa61c739c8e6d6581670438944dfcbc7c
Closes-Bug: #1856936
2019-12-20 14:53:37 +05:30
Frode Nordahl 529441eec9
Make use of default ``config.rendered`` handler
Change-Id: I32a01267e065e8535c4b3f2202b071f2f0193437
2019-11-29 08:08:36 +01:00
Liam Young b6c42e3260 Assess ceph request status until it is complete.
Due to a change in the ceph-client interface *1 the
storage-ceph.pools.available flag can be lost when the charm is
upgraded from an old version to the current version. To account for
this check the request status whenever there is an outstanding
ceph request.

*1 https://github.com/openstack/charm-interface-ceph-client/blame/master/requires.py#L107

Change-Id: I179df45af2fb2d4723cd579a1070ece0d18b5002
Closes-Bug: #1850618
2019-10-30 13:52:31 +00:00
Liam Young d0d2ac8864 Gate sending ceph pool creation request.
Add new state ceph.create_pool.req.sent to gate sending the ceph
pool creation request. This fixes a problem where the changed
method in requires of ceph-client interface raises the
'{relation_name}.pools.available' state but the create_pool
method then removes it again.

Also remove snap functional tests as they are no longer
needed since that install method via charms is not
actively supported.

Change-Id: Iaf986d24f005bcc7c8f485cfc2eb1775e6dbbbdd
Closes-Bug: #1846480
2019-10-07 07:30:55 +00:00
Frode Nordahl dec5ea676b
Enable default certificates handler
Previously the default ``certificates.available`` handler was
enabled without the charm authors intervention, this was changed
in I12f45236632b608e07fdd35d31b90b84ca92eb1f.

Change-Id: I4cbe72ce281cb36c6e2c7d9f745b21cd21623e56
2019-09-03 09:57:59 +02:00
Frode Nordahl 5b21b6cea5
Use Ceph helpers from ``charms.openstack``
The Ceph relation adapter and keyring helper code was moved to
``charms.openstack`` as part of development of the
``ceph-rbd-mirror`` charm.

Port the Gnocchi charm to re-use this code.

Depends-On: If1d645f4708e27b724f93cac0e14431137c885d7
Depends-On: I97b4c30dabfcf65ec3fb876c2a09a44172be85e7
Change-Id: If0da7f1efcfa6b61aa210edcd76e9c3392e0e8e9
2019-04-23 15:38:28 +02:00
David Ames 0a2315c196 Enable Bionic as a gate test
Change bionic test from dev to gate for 18.05.

Change-Id: Ib4cf1f94b3ba86380f79b5254e21de46f23d3c98
2018-05-16 14:31:14 -07:00
David Ames 4666b8024c Do not set gnocchi URL until clustering complete
Gnocchi was providing its URL to client charms before its VIP was
completely setup. This change checks that an hacluster relation
exists and if so waits to provide its URL until the hacluster setup
is complete.

Depends-On: I23eb5e70537a62d5b9e5e24d09f37519b63a1717
Change-Id: I3a6991ecb4eca8659c08d5c5d00d35b8d22bf79e
Closes-Bug: #1749280
2018-02-28 21:22:00 +00:00
James Page 76cd529b9a Switch to using charms.openstack memcache adapter
Minor refactor to drop use of local Memcache relation adapter
now that its been incorporated into charms.openstack.

Change-Id: I2b5d8ed26513574b34c1cdfd8edbe53bb1498343
2017-11-01 09:33:54 +00:00
Corey Bryant ecaea903e7 Add snap support
Enable snap installation support for Gnocchi.

The Gnocchi snap provides nginx and uwsgi instead of
Apache2 + mod_wsgi so the config/restart map looks a
little different.

Snap support has been implemented using a subclass of
the GnocchiCharmBase class, which provides common
methods and properties to both deb and snap based
installations.

Snaps are only published for Ocata or later releases
of OpenStack.

Change-Id: I464025a2b72aba8c31a4a97ade39d2b2980c3a92
2017-10-14 07:29:21 -04:00
James Page 0764051352 Default ceph pool name to service name
Ensure that the pool name requested matches the service name
for the application, inline with other OpenStack charms.

Change-Id: Ia3ee274b52bdb2cb90a17e43ec5a379e7765efe0
2017-09-25 11:05:26 +01:00
James Page a626949459 Ensure ceph keyring has correct perms 2017-08-02 11:50:46 +01:00
James Page 999ff47982 Capture default-select-release 2017-08-02 11:04:38 +01:00
James Page d8846632fd Rename coordinator relation to coordinator-memcached to support other furture options 2017-08-02 09:56:09 +01:00
James Page 15c6bcdb56 Update unit tests 2017-08-01 12:16:09 +01:00
James Page b85c2266f6 Add unit tests for adapters 2017-07-11 11:36:16 +01:00
James Page 450b91d5e8 Ensure metric url not set until service is fully configured 2017-07-11 11:26:23 +01:00
James Page 233cfde079 Add unit test for provide_gnocchi_url 2017-07-10 16:46:42 +01:00
James Page cb0b925679 Refactor class structure for unit tests 2017-07-10 16:42:07 +01:00
James Page 929f9a377d Add more unit tests for handlers 2017-07-10 16:40:56 +01:00
James Page fb7a088089 Basic unit tests 2017-07-10 16:02:31 +01:00
James Page 6154bf4d2f Tidy pep8 lint 2017-07-06 17:20:49 +01:00
James Page 1a9a8da5bd Initial charm version 2017-07-03 14:50:32 +01:00