From ee22c97b0f1700fa8c915c71bc3c162ef12c78f3 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 18 Apr 2012 11:32:19 -0700 Subject: [PATCH] python-ceph: remove rgw bindings We shouldn't expose these internal apis. Signed-off-by: Yehuda Sadeh --- debian/control | 2 +- src/pybind/rgw.py | 36 ------------------------------------ src/test/pybind/test_rgw.py | 24 ------------------------ 3 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 src/pybind/rgw.py delete mode 100644 src/test/pybind/test_rgw.py diff --git a/debian/control b/debian/control index 1e207dcb2e98d..e012392cbaf08 100644 --- a/debian/control +++ b/debian/control @@ -315,7 +315,7 @@ Description: synchronize data between cloud object storage providers or a local Package: python-ceph Architecture: linux-any Section: python -Depends: ${python:Depends}, librados2, librbd1, librgw1 +Depends: ${python:Depends}, librados2, librbd1 Description: Python libraries for the Ceph distributed filesystem Ceph is a distributed storage and network file system designed to provide excellent performance, reliability, and scalability. diff --git a/src/pybind/rgw.py b/src/pybind/rgw.py deleted file mode 100644 index cf36d5fa0b462..0000000000000 --- a/src/pybind/rgw.py +++ /dev/null @@ -1,36 +0,0 @@ -"""librgw Python ctypes wrapper -Copyright 2011, New Dream Network -""" -from ctypes import CDLL, c_char_p, c_void_p,\ - byref, c_int -import ctypes - -class Rgw(object): - """librgw python wrapper""" - def __init__(self): - self.lib = CDLL('librgw.so.1') - self.rgw = c_void_p(0) - ret = self.lib.librgw_create(byref(self.rgw), 0) - if (ret != 0): - raise Exception("librgw_create failed with error %d" % ret) - def __del__(self): - self.lib.librgw_shutdown(self.rgw) - def acl_bin2xml(self, blob): - blob_buf = ctypes.create_string_buffer(blob[:]) - xml = c_char_p(0) - ret = self.lib.librgw_acl_bin2xml(self.rgw, byref(blob_buf), len(blob), byref(xml)) - if (ret != 0): - raise Exception("acl_bin2xml failed with error %d" % ret) - rets = ctypes.string_at(xml) - self.lib.librgw_free_xml(self.rgw, xml) - return rets - def acl_xml2bin(self, xml): - blen = c_int(0) - blob = c_void_p(0) - ret = self.lib.librgw_acl_xml2bin(self.rgw, c_char_p(xml), - byref(blob), byref(blen)) - if (ret != 0): - raise Exception("acl_bin2xml failed with error %d" % ret) - rets = ctypes.string_at(blob, blen) - self.lib.librgw_free_bin(self.rgw, blob) - return rets diff --git a/src/test/pybind/test_rgw.py b/src/test/pybind/test_rgw.py deleted file mode 100644 index 6db194d994ebc..0000000000000 --- a/src/test/pybind/test_rgw.py +++ /dev/null @@ -1,24 +0,0 @@ -from nose.tools import eq_ as eq, assert_raises -from rgw import Rgw - -def test_rgw(): - rgw = Rgw() - xml = """ - - foo - MrFoo - - - - - bar - display-name - - FULL_CONTROL - - -""" - blob = rgw.acl_xml2bin(xml) - converted_xml = rgw.acl_bin2xml(blob) - converted_blob = rgw.acl_xml2bin(converted_xml) - eq(blob, converted_blob) -- 2.39.5