Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 32b0849

Browse files
committed
Modify query_semantic_version to not check patch version (could be -SNAPSHOT)
1 parent 54f2790 commit 32b0849

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

hawkular/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def __init__(self,
187187
# Call the server status endpoint to get the version number,
188188
# Use the return sematic version to set the value of legacy_api
189189
if auto_set_legacy_api:
190-
major, minor, patch = self.query_semantic_version()
190+
major, minor = self.query_semantic_version()
191191
self.legacy_api = (major == 0 and minor < 16)
192192

193193
def _get_base_url(self):
@@ -320,10 +320,10 @@ def query_semantic_version(self):
320320
status_hash = self.query_status()
321321
try:
322322
version = status_hash['Implementation-Version']
323-
major, minor, patch = map(int, version.split('.')[:3])
323+
major, minor = map(int, version.split('.')[:2])
324324
except Exception as e:
325325
self._handle_error(e)
326-
return major, minor, patch
326+
return major, minor
327327

328328
def query_status(self):
329329
return self._get(self._get_status_url())

tests/test_metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def test_tenant_changing(self):
260260
self.assertEqual(0, len(m))
261261

262262
def test_query_semantic_version(self):
263-
major, minor, patch = self.client.query_semantic_version()
263+
major, minor = self.client.query_semantic_version()
264264
self.assertTrue(0 <= major <= 1000)
265265
self.assertTrue(0 <= minor <= 1000)
266266

0 commit comments

Comments
 (0)