twister: do not recorde a null version
In some scenarios we might end up with a null version value in the json file, if the version can't be determined, set it to Unkown instead. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
9cb1ff7fce
commit
148a6e2ee1
1 changed files with 7 additions and 2 deletions
|
@ -698,8 +698,13 @@ class TwisterEnv:
|
|||
universal_newlines=True,
|
||||
cwd=ZEPHYR_BASE)
|
||||
if subproc.returncode == 0:
|
||||
self.version = subproc.stdout.strip()
|
||||
logger.info(f"Zephyr version: {self.version}")
|
||||
_version = subproc.stdout.strip()
|
||||
if _version:
|
||||
self.version = _version
|
||||
logger.info(f"Zephyr version: {self.version}")
|
||||
else:
|
||||
self.version = "Unknown"
|
||||
logger.error("Coult not determine version")
|
||||
except OSError:
|
||||
logger.info("Cannot read zephyr version.")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue