Giuseppe Lavagetto has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/220475

Change subject: conftool: version 0.1.1
......................................................................

conftool: version 0.1.1

* drivers/etcd: fix self.ls to respect the interface
* made the error for malformed yaml happen only when appropriate

Change-Id: Ic950c7b5c9f83fb52246c3803284f9404a132a63
---
M conftool/cli/syncer.py
M conftool/drivers/etcd.py
M debian/changelog
M setup.py
4 files changed, 14 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/conftool 
refs/changes/75/220475/1

diff --git a/conftool/cli/syncer.py b/conftool/cli/syncer.py
index 886b88d..c17b1e3 100644
--- a/conftool/cli/syncer.py
+++ b/conftool/cli/syncer.py
@@ -209,10 +209,12 @@
         try:
             with open(filename, 'rb') as fh:
                 dc_data = yaml.load(fh)
-            load_nodes(dc, dc_data)
         except:
             _log.error("Malformed yaml data in %s", filename)
             _log.error("Skipping loading/removing nodes, please correct!")
+        else:
+            load_nodes(dc, dc_data)
+
     # Now delete services
     for cluster, servnames in rem.items():
         remove_services(cluster, servnames)
diff --git a/conftool/drivers/etcd.py b/conftool/drivers/etcd.py
index 58a826d..eac9165 100644
--- a/conftool/drivers/etcd.py
+++ b/conftool/drivers/etcd.py
@@ -51,7 +51,10 @@
     @drivers.wrap_exception(etcd.EtcdException)
     def ls(self, path):
         key = self.abspath(path)
-        res = self.client.read(key)
+        try:
+            res = self.client.read(key)
+        except etcd.Exception:
+            raise ValueError("{} is not a directory".format(key))
         fullpath = key + '/'
         return [(el.key.replace(fullpath, ''), self._data(el))
                 for el in res.leaves
diff --git a/debian/changelog b/debian/changelog
index 34e8568..a6f27cc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+python-conftool (0.1.1) precise-wikimedia; urgency=medium
+
+  * Fix a bug introduced with performance improvements
+
+ -- Giuseppe Lavagetto <[email protected]>  Wed, 24 Jun 2015 17:06:17 
+0200
+
 python-conftool (0.1.0) precise-wikimedia; urgency=medium
 
   * Fix a bug in confctl handling of arguments
diff --git a/setup.py b/setup.py
index 67b4605..182e822 100755
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@
 
 setup(
     name='conftool',
-    version='0.1.0',
+    version='0.1.1',
     description='Collection of tools to interoperate with distributed k/v 
stores',
     author='Joe',
     author_email='[email protected]',

-- 
To view, visit https://gerrit.wikimedia.org/r/220475
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic950c7b5c9f83fb52246c3803284f9404a132a63
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/conftool
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to