aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornico <nico@magicbroccoli.de>2020-06-10 00:40:22 +0200
committernico <nico@magicbroccoli.de>2020-06-10 00:40:22 +0200
commit331adaf820c3f9c37457be667bd1fc775802cb99 (patch)
tree2aea0ab998abaa1472a32d8c4e4b3f9bb5b6181e
parent7ca08b12c0bcb1d69d0b04e4201f813b85dc75d0 (diff)
fixup
* update version regex to succesfully match only the version string + add missing import
-rw-r--r--api.py6
-rw-r--r--influx.py1
2 files changed, 4 insertions, 3 deletions
diff --git a/api.py b/api.py
index 82ac3e7..a83bae7 100644
--- a/api.py
+++ b/api.py
@@ -1,10 +1,10 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
+import logging
import re
from packaging import version
-import logging
class EjabberdApi:
"""
@@ -32,12 +32,12 @@ 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.]+(?![.a-z]))\\b')
status = self.cmd('status', {})
# matches
try:
- tmp = ver_str.findall(status)[1]
+ tmp = ver_str.findall(status)[0]
# raise SystemExit code 17 if no status message is received
except TypeError:
raise SystemExit(17)
diff --git a/influx.py b/influx.py
index 979176a..2a0dcf5 100644
--- a/influx.py
+++ b/influx.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
+import logging
import time
from influxdb import InfluxDBClient