Commit Graph

14 Commits

Author SHA1 Message Date
José Julián Espina c4eadc8a8e
test: add unit testing for new "create-cephfs-client" op
This adds tests for the changes in Change-Id: I64b8b158d519084b88bd91496124d348fef51123

Change-Id: I9063059433c514f31ff0161bc24b20f24e19043d
2024-04-29 10:34:12 -06:00
Luciano Lo Giudice 5745ed3ba8 Add permission in mon key for newly named command
Starting with Pacific, the 'osd blacklist' command was renamed to
'osd blocklist'. This patchset changes the allowed commands to
reflect this change.

Change-Id: If2169734f67d21c1c7c1b75677f14ebd0ea054ae
Closes-Bug: #1968369
2022-04-13 10:27:39 -03:00
Alex Kavanagh 272abf6e55 Fix breaking in code if extra_pools is passed as None
The code currently assumes that a empty list will be passed rather than
None, so this change defensively codes against a None being passed
(deserialised from json) so that it is correctly parsed as "no extra
pools".  Also modified the test to push None to the function to verify
that it handles the situation

Change-Id: I27220696f64b65280f24cab2328e1366fcbbdf4f
Closes-Bug: #1897574
2020-09-28 16:44:57 +01:00
Liam Young 648cac3ba8 Handle additional pools for CephFS
If ceph-fs requests additional pools are added to the ceph fs
share to be created then add them once the share is created.

This allows ceph-fs to specify replicated pools for metadata and
default datapool but to then extend the fs with EC pools.

Change-Id: I80b7a5cc87d7d53bb55d4d65999a0f9b3cdcb77d
2020-09-10 14:34:58 +00:00
Frode Nordahl af0eac506d
Use common pool create/update handling code
Use the Pool classes ability to initialize themselves from op.

Some pool properties should be allowed adjusted after a pool is
created.

The Pool quota property is already handled ad-hoc in the
`charms.ceph` broker handling code, let's bring it over to the
pool objects along with the handling of the compression properties.

Move some missing unit tests here from ceph-mon charm.

Merge after https://github.com/juju/charm-helpers/pull/497

Change-Id: Ibec4e3221387199adbc1a920e130975d7b25343c
2020-08-26 15:27:03 +02:00
Pedro Guimaraes 89b3b8d1eb Update support for Erasure Coded pools
Add support to allow 'allow_ec_overwrites' to be set on a pool,
supporting RBD and CephFS uses cases for Erasure Coding.

Add support to allow the EC technique to be provided when
creating EC profiles.

Add support for extended configuration of EC plugins.

Depends-On: https://github.com/juju/charm-helpers/pull/498
Change-Id: I2547933964849f7af1c623b2fbc014fb332839ef
2020-08-07 09:10:11 +01:00
Hervé Beraud 4f135d9e97 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.

Change-Id: Id257b597368aff252ce7120b9dbc02f21a41e629
2020-06-09 00:03:48 +02:00
Corey Bryant c5a7e8f1c8 Rename ceph to charms_ceph
The new python3-ceph-common deb package (introduced in ceph octopus)
adds a new ceph directory (a parent package in python terms) in
/usr/lib/python3/dist-packages/ceph/. This results in a conflict with
charm-ceph-xyz/lib/ceph/ on imports. For example, with the current
import of ceph.utils in ceph-osd/hooks/ceph_hooks.py, Python finds no
utils.py in /usr/lib/python3/dist-packages/ceph/ and then stops
searching. Therefore, rename ceph to charms_ceph to avoid the
conflict.

Change-Id: I6eaf03e291f65125269b1836dd2636806f9945e1
2020-02-24 15:19:34 +00:00
Chris MacNaughton bb708ad4c4 Add new permission request to broker
Change-Id: Ifd341bd80833d4a7fd62e89e3c0e2b7fd64fafba
2019-11-07 20:07:58 +08:00
James Page 4d8f31d0ea Add 'osd blacklist' to default mon perms
Ensure that the default permissions for clients include the
'osd blacklist' command;  This ensures that in the event of
a client crashing (due to power outage or segfault), the
client and re-connect and write to any devices on reboot.

Change-Id: I0b43dece4e1c56fb838b0147bfb75fb9906e6657
Closes-Bug: 1773449
2018-06-11 09:11:08 +01:00
James Page 1ccf7c2b25 tests: improve idempotency and isolation
Use sort_keys when serializing in json format for idempotency under
Python 3; Mock out calls to get_osds in broker test to ensure that
a local install of ceph-common does not cause unit test failures.

Change-Id: I6ce4075fd38e8431372a359cc88332d2da7a3974
2018-01-09 13:50:15 +00:00
Liam Young d94dc3e7b9 Add support for object_prefix permissions
The grammer for ceph osd capabilities shows that permissions can
be applied to a pool or to a object_prefix:

match   := [pool[=]<poolname> | object_prefix <prefix>]

This patch adds support for requesting object_prefix permissions on
a given set of prefixes.

http://docs.ceph.com/docs/firefly/man/8/ceph-authtool/#osd-capabilities

Partial-Bug: #1696073

Change-Id: I799f87fe2178ed7d3e44f14e2fa0683f917d2f0d
2017-12-13 13:54:06 +00:00
Liam Young 6ea5e98786 Add unit tests to cover permissions requests
Add unit tests to increase coverage of permissions requests from
broker. This is a prerequisite for work to add object prefix
permissions.

Sort permissions list to ensure permissions string does keep changing
when running under py3.

Change-Id: Ib7f9f59d157edbd223e848e7e2fde2e27556f079
2017-12-12 15:50:09 +00:00
Edward Hope-Morley dd978b7bd0 Code cleanup
* import ordering
* doctrings
* unit tests cleanup
* move code out of __init__.py
* rename files

Change-Id: Id56d4ea1a0cca33df03f40222bbf51a6bef58b20
2017-08-11 12:42:29 +01:00