From c7fd20e4784ccb46fd25d012fa1a17ac245c0edf Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 7 Jun 2020 23:12:19 +0200 Subject: [PATCH] python: get version via API --- python/villas/node/node.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/villas/node/node.py b/python/villas/node/node.py index d7862b809..a89bbaf94 100644 --- a/python/villas/node/node.py +++ b/python/villas/node/node.py @@ -90,7 +90,12 @@ class Node(object): return r.json() def get_version(self): - ver = subprocess.check_output([ self.executable, '-V'], ) + try: + resp = self.request('capabilities') + + return resp['response']['build'] + except Exception: + ver = subprocess.check_output([self.executable, '-V'], ) return ver.decode('ascii').rstrip()