diff options
author | Andrew Maguire <andrewm4894@gmail.com> | 2023-02-28 10:24:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-28 12:24:41 +0200 |
commit | c8b4f19013182b03b6ba727dd784181e1beb8bf9 (patch) | |
tree | e16bfd8d436e0a715a462d8939542402a2582a1c /collectors/python.d.plugin/anomalies | |
parent | ea3807ed5bdb09ccf5c889678e08bc55853a94e3 (diff) |
fix python version check to work for 3.10 and above (#14616)
Diffstat (limited to 'collectors/python.d.plugin/anomalies')
-rw-r--r-- | collectors/python.d.plugin/anomalies/anomalies.chart.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/collectors/python.d.plugin/anomalies/anomalies.chart.py b/collectors/python.d.plugin/anomalies/anomalies.chart.py index 8ca3df6822..24e84cc15c 100644 --- a/collectors/python.d.plugin/anomalies/anomalies.chart.py +++ b/collectors/python.d.plugin/anomalies/anomalies.chart.py @@ -58,8 +58,7 @@ class Service(SimpleService): self.collected_dims = {'probability': set(), 'anomaly': set()} def check(self): - python_version = float('{}.{}'.format(sys.version_info[0], sys.version_info[1])) - if python_version < 3.6: + if not (sys.version_info[0] >= 3 and sys.version_info[1] >= 6): self.error("anomalies collector only works with Python>=3.6") if len(self.host_charts_dict[self.host]) > 0: _ = get_allmetrics_async(host_charts_dict=self.host_charts_dict, protocol=self.protocol, user=self.username, pwd=self.password) |