-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Execute
cmsRun
to validate driver parameters
Instead of just creating the Python configuration, execute `cmsRun` and simulate a few events to cross-check the driver parameters. Allow users to set this behavior in the `RelVal` attributes.
- Loading branch information
Showing
6 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
""" | ||
This script sets the new attribute | ||
`execute_steps` on every `RelVal` object that | ||
does not include it already. | ||
""" | ||
import sys | ||
import os.path | ||
import os | ||
# pylint: disable-next=wrong-import-position | ||
sys.path.append(os.path.abspath(os.path.pardir)) | ||
from core_lib.database.database import Database | ||
|
||
# Configure the database client | ||
mongo_db_username = os.getenv("MONGO_DB_USERNAME", "") | ||
mongo_db_password = os.getenv("MONGO_DB_PASSWORD", "") | ||
mongo_db_host = os.getenv("MONGO_DB_HOST", "") | ||
mongo_db_port = int(os.getenv("MONGO_DB_PORT", "27017")) | ||
Database.set_host_port(host=mongo_db_host, port=mongo_db_port) | ||
Database.set_credentials(username=mongo_db_username, password=mongo_db_password) | ||
Database.set_database_name('relval') | ||
|
||
database = Database('relvals') | ||
total_entries = database.get_count() | ||
print('Total entries: %s' % (total_entries)) | ||
|
||
for index, item in enumerate(database.query(limit=total_entries)): | ||
print('Processing entry %s/%s %s' % (index + 1, total_entries, item.get('prepid', '<no-id>'))) | ||
execute_steps = item.get('execute_steps') | ||
if execute_steps is None: | ||
item['execute_steps'] = False | ||
database.save(item) | ||
|
||
print('Done') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters