Merge pull request #229 from zalando/bugfix/env-zookeeper-hosts

Document that every single zookeeper host:port MUST be quoted
This commit is contained in:
Alexander Kukushkin
2016-06-30 12:09:03 +02:00
committed by GitHub
4 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -55,4 +55,4 @@ REST API
ZooKeeper
---------
- **PATRONI\_ZOOKEEPER\_HOSTS**: comma separated list of ZooKeeper cluster members: 'host1:port1,host2:port2,etc...'
- **PATRONI\_ZOOKEEPER\_HOSTS**: comma separated list of ZooKeeper cluster members: "'host1:port1','host2:port2','etc...'". It is important to quote every single entity!
+1 -1
View File
@@ -283,7 +283,7 @@ class ZooKeeperController(AbstractDcsController):
def __init__(self, output_dir, export_env=True):
super(ZooKeeperController, self).__init__('zookeeper', None, output_dir)
if export_env:
os.environ['PATRONI_ZOOKEEPER_HOSTS'] = 'localhost:2181'
os.environ['PATRONI_ZOOKEEPER_HOSTS'] = "'localhost:2181'"
self._client = kazoo.client.KazooClient()
def _start(self):
+1
View File
@@ -224,6 +224,7 @@ class Config(object):
try:
return yaml.safe_load(value)
except Exception:
logger.exception('Exception when parsing list %s', value)
return None
for param in list(os.environ.keys()):
+1 -1
View File
@@ -41,7 +41,7 @@ class TestConfig(unittest.TestCase):
'PATRONI_POSTGRESQL_PGPASS': '/tmp/pgpass0',
'PATRONI_ETCD_HOST': '127.0.0.1:2379',
'PATRONI_CONSUL_HOST': '127.0.0.1:8500',
'PATRONI_ZOOKEEPER_HOSTS': 'host1,host2',
'PATRONI_ZOOKEEPER_HOSTS': "'host1:2181','host2:2181'",
'PATRONI_EXHIBITOR_HOSTS': 'host1,host2',
'PATRONI_EXHIBITOR_PORT': '8181',
'PATRONI_foo_HOSTS': '[host1,host2', # Exception in parse_list