Compatibility with python 3.7.6 (#1368)

The urlparse function has changed.

Old versions:
```python
>>> urlparse('localhost:8500')
ParseResult(scheme='', netloc='', path='localhost:8500', params='', query='', fragment='')
```

3.7.6:
```python
>>> urlparse('localhost:8500')
ParseResult(scheme='localhost', netloc='', path='8500', params='', query='', fragment='')
```
This commit is contained in:
Alexander Kukushkin
2020-01-24 12:52:34 +01:00
committed by GitHub
parent 27ff9dfda3
commit 0eb1e0568b
+2 -2
View File
@@ -49,11 +49,11 @@ class PatroniCtlException(ClickException):
def parse_dcs(dcs):
if dcs is None:
return None
elif '//' not in dcs:
dcs = '//' + dcs
parsed = urlparse(dcs)
scheme = parsed.scheme
if scheme == '' and parsed.netloc == '':
parsed = urlparse('//' + dcs)
port = int(parsed.port) if parsed.port else None
if scheme == '':