1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-30 00:00:11 +01:00

python: get version via API

This commit is contained in:
Steffen Vogel 2020-06-07 23:12:19 +02:00
parent c1a3652e59
commit c7fd20e478

View file

@ -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()