Skip to content
Snippets Groups Projects
Commit d3b889a3 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

MetaReaderPeeker: remove support of CA config

Remove the support for CA jobs in the legacy `MetaReaderPeeker`. This
workaround relied on the existence of the deprecated global
`ConfigFlags` which are due to be removed.

Eventually the entire code should be removed.
parent 0bb9eb1f
No related branches found
No related tags found
2 merge requests!691662024-02-23: merge of 24.0 into main,!69107MetaReaderPeeker: remove support of CA config
#!/usr/bin/env python
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
__all__ = ['metadata', 'convert_itemList', 'convert_metadata_items']
......@@ -15,24 +15,17 @@ def _setup():
global metadata
# get input file name
# Start by checking ConfigFlags
from AthenaConfiguration.AllConfigFlags import ConfigFlags
inFiles = ConfigFlags.Input.Files
if inFiles == ['_ATHENA_GENERIC_INPUTFILE_NAME_']:
# Input files have not been set in ConfigFlags
# Fall back to the legacy configuration mechanisms
try:
from RecExConfig.RecoFunctions import InputFileNames
inFiles = InputFileNames()
except ModuleNotFoundError:
try:
msg.warning("Input files not set ConfigFlags.Input.Files. Falling back to the legacy way of obtaining input file names")
from RecExConfig.RecoFunctions import InputFileNames
inFiles = InputFileNames()
msg.warning("In a release without RecExConfig, trying AthenaCommonFlags")
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
inFiles = athenaCommonFlags.FilesInput()
except ModuleNotFoundError:
try:
msg.warning("In a release without RecExConfig, trying AthenaCommonFlags")
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
inFiles = athenaCommonFlags.FilesInput()
except ModuleNotFoundError:
msg.warning("Failed to load any module containing list of input files")
pass
msg.warning("Failed to load any module containing list of input files")
pass
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
if athenaCommonFlags.isOnline() and (not inFiles or all([f.strip() == '' for f in inFiles])):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment