Skip to content

Commit

Permalink
Merge pull request #351 from DUNE-DAQ/eflumerf/ExpandVarsForDataFiles
Browse files Browse the repository at this point in the history
Eflumerf/expand vars for data files
  • Loading branch information
eflumerf authored Aug 17, 2023
2 parents d30271a + 1738710 commit a0fe335
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/daqconf/core/assets.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

from os.path import exists,abspath,dirname
from os.path import exists,abspath,dirname,expandvars

from .console import console


from daq_assettools.asset_file import AssetFile
from daq_assettools.asset_database import Database
from sqlite3 import OperationalError
Expand Down Expand Up @@ -49,10 +48,11 @@ def resolve_asset_file(data_file, verbose):

return filename

if data_file != '' and not exists(data_file):
resolved_data_file = abspath(expandvars(data_file))
if resolved_data_file != '' and not exists(resolved_data_file):
raise RuntimeError(f'Cannot find the frames.bin file {data_file}')

if verbose:
console.log(f"Found asset in {dirname(abspath(data_file))}")
console.log(f"Found asset in {dirname(resolved_data_file)}")

return abspath(data_file)
return resolved_data_file

0 comments on commit a0fe335

Please sign in to comment.