File tree 1 file changed +14
-1
lines changed
src/model_execution_worker
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 15
15
import logging
16
16
import json
17
17
import os
18
+ import re
18
19
import tempfile
19
20
import shutil
20
21
import subprocess
@@ -180,10 +181,22 @@ def get_oed_version():
180
181
return None
181
182
182
183
184
+ def get_ktools_version ():
185
+ ktool_ver_str = subprocess .getoutput ('fmcalc -v' )
186
+
187
+ # Match version x.x.x , x.x or x
188
+ reg_pattern = "(\d+\.)?(\d+\.)?(\d+)"
189
+ match_ver = re .search (reg_pattern , ktool_ver_str )
190
+
191
+ if match_ver :
192
+ ktool_ver_str = match_ver [0 ]
193
+ return ktool_ver_str
194
+
195
+
183
196
def get_worker_versions ():
184
197
""" Search and return the versions of Oasis components
185
198
"""
186
- ktool_ver_str = subprocess . getoutput ( 'fmcalc -v' )
199
+ ktool_ver_str = get_ktools_version ( )
187
200
plat_ver_file = '/home/worker/VERSION'
188
201
oed_schma_ver = get_oed_version ()
189
202
You can’t perform that action at this time.
0 commit comments