diff options
author | genofire <geno+dev@fireorbit.de> | 2020-06-09 20:18:21 +0200 |
---|---|---|
committer | genofire <geno+dev@fireorbit.de> | 2020-06-09 20:19:30 +0200 |
commit | 52dc918125efce4a1c0f86009d183142a149a81d (patch) | |
tree | f12bcb9d9332260cc7ffc93dab7b719f9deb4b47 | |
parent | 8df15a559514c07d992cbd24ccf738f40d110f88 (diff) |
fix versionstring parsing
-rw-r--r-- | api.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -4,6 +4,7 @@ import re from packaging import version +import logging class EjabberdApi: """ @@ -31,17 +32,18 @@ class EjabberdApi: @property def verstring(self): if self._login is not None: - ver_str = re.compile('([1-9][0-9.]*)') + ver_str = re.compile('([1-9][0-9.]+)') status = self.cmd('status', {}) # matches try: - tmp = ver_str.findall(status)[0] + tmp = ver_str.findall(status)[1] # raise SystemExit code 17 if no status message is received except TypeError: raise SystemExit(17) # return parsed version string + logging.debug(f"fetch version: {tmp}") return version.parse(tmp) return None |