Tweak how postgresql version is detected

pattern match didn't work for the 10.5 version
This commit is contained in:
Lance Edgar 2018-09-06 11:38:56 -05:00
parent 190a8318cc
commit 12a29f2088

View file

@ -47,7 +47,7 @@ def get_version():
""" """
result = sudo('psql --version') result = sudo('psql --version')
if result.succeeded: if result.succeeded:
match = re.match(r'^psql \(PostgreSQL\) (\d+\.\d+)\.\d+', result) match = re.match(r'^psql \(PostgreSQL\) (\d+\.\d+)(?:\.\d+)?', result)
if match: if match:
return float(match.group(1)) return float(match.group(1))