hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r979461 - in /hadoop/zookeeper/trunk: CHANGES.txt src/contrib/zkpython/src/c/zookeeper.c src/contrib/zkpython/src/test/connection_test.py
Date Mon, 26 Jul 2010 21:48:48 GMT
Author: mahadev
Date: Mon Jul 26 21:48:47 2010
New Revision: 979461

URL: http://svn.apache.org/viewvc?rev=979461&view=rev
Log:
ZOOKEEPER-821. Add ZooKeeper version information to zkpython (Rich Schumacher via mahadev)

Modified:
    hadoop/zookeeper/trunk/CHANGES.txt
    hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c
    hadoop/zookeeper/trunk/src/contrib/zkpython/src/test/connection_test.py

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=979461&r1=979460&r2=979461&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Mon Jul 26 21:48:47 2010
@@ -88,6 +88,9 @@ IMPROVEMENTS:
 
   ZOOKEEPER-790. Last processed zxid set prematurely while establishing leadership (fpj via
breed)
 
+  ZOOKEEPER-821. Add ZooKeeper version information to zkpython (Rich
+  Schumacher via mahadev)
+
 NEW FEATURES:
   ZOOKEEPER-729. Java client API to recursively delete a subtree.
   (Kay Kay via henry)

Modified: hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c?rev=979461&r1=979460&r2=979461&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c (original)
+++ hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c Mon Jul 26 21:48:47 2010
@@ -1510,6 +1510,12 @@ PyMODINIT_FUNC initzookeeper(void) {
   PyModule_AddObject(module, "ZooKeeperException", ZooKeeperException);
   Py_INCREF(ZooKeeperException);
 
+  int size = 10;
+  char version_str[size];
+  snprintf(version_str, size, "%i.%i.%i", ZOO_MAJOR_VERSION, ZOO_MINOR_VERSION, ZOO_PATCH_VERSION);
+
+  PyModule_AddStringConstant(module, "__version__", version_str);
+
   ADD_INTCONSTANT(PERM_READ);
   ADD_INTCONSTANT(PERM_WRITE);
   ADD_INTCONSTANT(PERM_CREATE);

Modified: hadoop/zookeeper/trunk/src/contrib/zkpython/src/test/connection_test.py
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zkpython/src/test/connection_test.py?rev=979461&r1=979460&r2=979461&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zkpython/src/test/connection_test.py (original)
+++ hadoop/zookeeper/trunk/src/contrib/zkpython/src/test/connection_test.py Mon Jul 26 21:48:47
2010
@@ -16,7 +16,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import unittest, threading
+import unittest, threading, re
 
 import zookeeper, zktestbase
 ZOO_OPEN_ACL_UNSAFE = {"perms":0x1f, "scheme":"world", "id" :"anyone"}
@@ -117,6 +117,9 @@ class ConnectionTest(zktestbase.TestBase
 
         self.assertEqual(True, all( zookeeper.close(h) == zookeeper.OK for h in handles ))
 
+    def testversionstringexists(self):
+        self.assertTrue(hasattr(zookeeper, '__version__'))
+        self.assertTrue(re.match("\d.\d.\d", zookeeper.__version__))
 
 
     def tearDown(self):



Mime
View raw message