Skip to content

Commit

Permalink
librbdpy: Use new rados lib
Browse files Browse the repository at this point in the history
Signed-off-by: Mehdi Abaakouk <[email protected]>
  • Loading branch information
Mehdi Abaakouk committed Feb 17, 2016
1 parent 7216b06 commit c4162b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/pybind/rbd/rbd.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ from libc.stdlib cimport realloc, free

from collections import Iterable

cimport rados


cdef extern from "Python.h":
# These are in cpython/string.pxd, but use "object" types instead of
# PyObject*, which invokes assumptions in cpython that we need to
Expand Down Expand Up @@ -296,8 +299,9 @@ cdef make_ex(ret, msg):
else:
return Error(msg + (": error code %d" % ret))

cdef rados_ioctx_t convert_ioctx(ioctx) except? NULL:
return <rados_ioctx_t><uintptr_t>ioctx.io.value

cdef rados_ioctx_t convert_ioctx(rados.Ioctx ioctx) except? NULL:
return <rados_ioctx_t>ioctx.io

cdef int no_op_progress_callback(uint64_t offset, uint64_t total, void* ptr):
return 0
Expand Down
4 changes: 3 additions & 1 deletion src/pybind/rbd/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def cythonize(x, **kwargs):
["rbd.pyx"],
libraries=["rbd"]
)
], build_dir=os.environ.get("CYTHON_BUILD_DIR", None)),
], build_dir=os.environ.get("CYTHON_BUILD_DIR", None), include_path=[
os.path.join(os.path.dirname(__file__), "..", "rados")]
),
cmdclass={
"egg_info": EggInfoCommand,
},
Expand Down

0 comments on commit c4162b5

Please sign in to comment.