Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix --dump_python option in cmsDriver #11823

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions Configuration/Applications/scripts/cmsDriver.py
Expand Up @@ -12,6 +12,18 @@ def run():

# after cleanup of all config parameters pass it to the ConfigBuilder
configBuilder = ConfigBuilder(options, with_output = True, with_input = True)

# Switch on any eras that have been specified. This is not required to create
# the file, it is only relevant if dump_python is set. It does have to be done
# before the prepare() call though. If not, then the config files will be loaded
# without applying the era changes. This doesn't affect the config file written,
# but when the dump_python branch uses execfile to read it back in it doesn't
# reload the modules - it picks up a reference to the already loaded ones.
if hasattr( options, "era" ) :
from Configuration.StandardSequences.Eras import eras
for eraName in options.era.split(',') :
getattr( eras, eraName )._setChosen()

configBuilder.prepare()
# fetch the results and write it to file
config = file(options.python_filename,"w")
Expand Down