[serverctl] avoid a crash if zmq-address is not defined/empty (config.get is a false friend wrt dict behaviour)
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 25 Apr 2012 11:39:14 +0200
changeset 8376 f42dcb798142
parent 8373 36e48c763c6e
child 8378 76ce456f8f07
[serverctl] avoid a crash if zmq-address is not defined/empty (config.get is a false friend wrt dict behaviour)
server/serverctl.py
--- a/server/serverctl.py	Thu Apr 12 19:08:30 2012 +0200
+++ b/server/serverctl.py	Wed Apr 25 11:39:14 2012 +0200
@@ -662,7 +662,7 @@
     def create_repo(self, config):
         address = self['address']
         if not address:
-            address = config.get('zmq-repository-address', 'pyro://')
+            address = config.get('zmq-repository-address') or 'pyro://'
         if address.startswith('pyro://'):
             from cubicweb.server.server import RepositoryServer
             return RepositoryServer(config), config['host']