Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop cradox #1248

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,7 @@ be created for example with:


Gnocchi leverages some *librados* features (omap, async, operation context)
available in the Python binding only since *python-rados* >= 12.2.0. To handle
this, Gnocchi uses *cradox* python library which has exactly the same API but
works with Ceph >= 0.80.0.

If Ceph and python-rados are >= 12.2.0, the cradox Python library becomes
optional but is still recommended.
available in the Ceph Python binding only since *python-rados* >= 12.2.0.


Configuration
Expand Down
5 changes: 2 additions & 3 deletions gnocchi/carbonara.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,8 @@ def group_serie(self, granularity, start=None):

@staticmethod
def _compress(payload):
# FIXME(jd) lz4 > 0.9.2 returns bytearray instead of bytes. But Cradox
# does not accept bytearray but only bytes, so make sure that we have a
# byte type returned.
# FIXME(jd) lz4 > 0.9.2 returns bytearray instead of bytes but we need
# a byte type returned.
return memoryview(lz4.block.compress(payload)).tobytes()


Expand Down
19 changes: 7 additions & 12 deletions gnocchi/common/ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,10 @@

LOG = daiquiri.getLogger(__name__)


for RADOS_MODULE_NAME in ('rados', 'cradox'):
try:
rados = __import__(RADOS_MODULE_NAME)
except ImportError:
pass
else:
break
else:
RADOS_MODULE_NAME = 'rados'
try:
rados = __import__(RADOS_MODULE_NAME)
except ImportError:
RADOS_MODULE_NAME = None
rados = None

Expand All @@ -48,12 +43,12 @@ def create_rados_connection(conf):
options['client_mount_timeout'] = conf.ceph_timeout

if not rados:
raise ImportError("No module named 'rados' nor 'cradox'")
raise ImportError("No module named 'rados'")

if not hasattr(rados, 'OmapIterator'):
raise ImportError("Your rados python module does not support "
"omap feature. Install 'cradox' (recommended) "
"or upgrade 'python-rados' >= 9.1.0 ")
"omap feature. Install or upgrade "
"'python-rados' >= 9.1.0 ")

LOG.info("Ceph storage backend use '%s' python library",
RADOS_MODULE_NAME)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
upgrade:
- |
Cradox is no longer maintained or supported, please use the python rados
module that can be installation from your distributions package manager.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ redis =
swift =
python-swiftclient>=3.1.0
ceph =
cradox>=2.0.0
# No deps - need rados dist package
ceph_alternative =
python-rados>=12.2.0 # not available on pypi
prometheus =
Expand Down