From fee07efabbe3cde80113ce9cf65329b6c4c94859 Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Mon, 18 Apr 2016 18:09:36 +0200 Subject: [PATCH] Fix python3 bugs --- patroni/ctl.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/patroni/ctl.py b/patroni/ctl.py index b6f7eb0a..3e382ce0 100644 --- a/patroni/ctl.py +++ b/patroni/ctl.py @@ -33,14 +33,14 @@ class PatroniCtlException(ClickException): def parse_dcs(dcs): """ Break up the provided dcs string - >>> parse_dcs('localhost') - {'etcd': {'host': 'localhost:4001'}} - >>> parse_dcs('localhost:8500') - {'consul': {'host': 'localhost:8500'}} - >>> parse_dcs('zookeeper://localhost') - {'zookeeper': {'hosts': ['localhost:2181']}} - >>> parse_dcs('exhibitor://localhost') - {'zookeeper': {'exhibitor': {'hosts': ['localhost'], 'port': 8181}}} + >>> parse_dcs('localhost') == {'etcd': {'host': 'localhost:4001'}} + True + >>> parse_dcs('localhost:8500') == {'consul': {'host': 'localhost:8500'}} + True + >>> parse_dcs('zookeeper://localhost') == {'zookeeper': {'hosts': ['localhost:2181']}} + True + >>> parse_dcs('exhibitor://localhost') == {'zookeeper': {'exhibitor': {'hosts': ['localhost'], 'port': 8181}}} + True """ if not dcs: @@ -113,7 +113,7 @@ def ctl(ctx): def get_dcs(config, scope): dcs_config = config.get('dcs', {}) - dcs_config[dcs_config.keys()[0]]['scope'] = scope + dcs_config[list(dcs_config.keys())[0]]['scope'] = scope try: return Patroni.get_dcs(scope, dcs_config) except PatroniException as e: