Commit Graph

13 Commits

Author SHA1 Message Date
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
Frode Nordahl 203840bd69
Add setting ``max_objects`` quota and retrieving erasure code profile
Also fix a few missing redirects of STDERR

Change-Id: I243328af5db202f092c53b4d48e0d293378d2ca0
2019-02-27 11:48:29 +01:00
James Page c0d3f4d246 Add support for crush_rule pool key
Later ceph versions allow the crush_rule to be changed on a pool;
add this key with type str to the list of supported keys for
the pool broker.

Change-Id: I2c405f9a4956ff1ccf1edb7372a9bb11e1e591a4
2019-02-18 10:58:19 +00: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
Zuul 71c1b138f3 Merge "Added more pool keys to ceph broker" 2018-05-15 07:46:34 +00:00
Chris Sanders c84b7b9449 Added more pool keys to ceph broker
Added allow_ec_overrites
Added compression_mode
Added compression_algorithm
Added compression_required_ratio

Change-Id: I240cad9e4451dd8e21c2e288903343f7a4bdeb5f
Closes-Bug: #1740726
2018-05-14 15:04:16 -05:00
Chris MacNaughton 978e561782 Add broker support for passing app_name
In Ceph >= Luminous, application name needs to be set
on a per-pool level to avoid health warnings. This
change adds support for sending the application name
over the broker channel from consuming charms.

When a name is not sent from the other side of the
relation, the application name will be set to "unknown"
in Luminous and greater

Change-Id: I99ae47b6802f50ea019751ffa328f11567cca567
Closes-Bug: #1753640
2018-04-26 13:21:46 +02: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
Alex Kavanagh 407d98b96a Make charms.ceph fully py2/py3 compatible
These changes make the charms.ceph library suitable for both the
old-stable Python 2 charms and the (to be) updates Python 3 only charms.
Avoided use of six by using str() with the decode('UTF-8') function to
allow the library to be used with both Py2 and Py3.  The str(...)
coercions can be removed at a later date when the library no longer
needs to be synced to Py2 versions of the ceph-* charms.

Change-Id: I416053439444bf4cf8945d1fe96643f9ed0f05f4
2017-10-30 12:02:58 +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