]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
python-ceph: remove rgw bindings
authorYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 18 Apr 2012 18:32:19 +0000 (11:32 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 18 Apr 2012 18:32:19 +0000 (11:32 -0700)
We shouldn't expose these internal apis.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
debian/control
src/pybind/rgw.py [deleted file]
src/test/pybind/test_rgw.py [deleted file]

index 1e207dcb2e98d183e70ceec1be36fb50847355bd..e012392cbaf08582afff02ab8837ea8888715436 100644 (file)
@@ -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 (file)
index cf36d5f..0000000
+++ /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 (file)
index 6db194d..0000000
+++ /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 = """<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
-  <Owner>
-    <ID>foo</ID>
-    <DisplayName>MrFoo</DisplayName>
-  </Owner>
-  <AccessControlList>
-    <Grant>
-      <Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\">
-       <ID>bar</ID>
-       <DisplayName>display-name</DisplayName>
-      </Grantee>
-      <Permission>FULL_CONTROL</Permission>
-    </Grant>
-  </AccessControlList>
-</AccessControlPolicy>"""
-    blob = rgw.acl_xml2bin(xml)
-    converted_xml = rgw.acl_bin2xml(blob)
-    converted_blob = rgw.acl_xml2bin(converted_xml)
-    eq(blob, converted_blob)