Delete IR workspace before importing new one

Change-Id: Ib6c7c16bf3656dcfbdde3221fce1c07c5c05b502
This commit is contained in:
Federico Ressi 2020-06-09 14:56:29 +02:00
parent 51f9a3a279
commit 151bfae959

View File

@ -69,12 +69,12 @@ def ensure_workspace(filename=None):
workspace = common.name_from_path(filename)
if os.path.isfile(filename):
try:
common.execute('ir workspace import "{}"', filename)
common.execute('ir workspace delete "{}"', workspace)
except subprocess.CalledProcessError as ex:
LOG.debug("workspace file '%s' not imported: %s", filename, ex)
else:
LOG.info("workspace imported from file '%s'", filename)
return
LOG.debug("workspace '%s' not deleted: %s", workspace, ex)
common.execute('ir workspace import "{}"', filename)
LOG.info("workspace imported from file '%s'", filename)
return
else:
LOG.debug("workspace file not found: '%s'", filename)