Skip to content
Snippets Groups Projects
Commit c35838f4 authored by Patrick Koppenburg's avatar Patrick Koppenburg :leaves:
Browse files

Merge branch 'dfazzini_error_runmc' into 'master'

Adding error message when using 'run-mc'

See merge request lhcb/DaVinci!708
parents 9e40dc59 66891b16
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!708Adding error message when using 'run-mc'
Pipeline #4076938 passed
......@@ -30,9 +30,9 @@ A DaVinci job can be run using the command line:
"""
import os, sys, click
from DaVinci.utilities_script import (dump_call, get_configurable_opts,
set_testfiledb, create_inputdb_template,
create_jobopt_template, get_dummy_config)
from DaVinci.utilities_script import (
dump_call, get_configurable_opts, set_testfiledb, create_inputdb_template,
create_jobopt_template, get_dummy_config, check_for_deprecated_command)
from DaVinci.Configuration import run_davinci_app
from DaVinci.config import options
from DaVinci.optionChecker import log_click
......@@ -222,6 +222,9 @@ def main_command(ctx, inputfiledb, joboptfile, override_data_options):
inputfiledb_key, inputfiledb_file = set_testfiledb(inputfiledb)
# Temporary check raising an error message if the deprecated 'run-mc' command is used.
check_for_deprecated_command(ctx_args)
dump_call(inputfiledb_file, inputfiledb_key, joboptfile, ctx_args)
config = run_davinci_app(
......
......@@ -206,3 +206,14 @@ def create_inputdb_template(file_name="inputdb_template.yaml"):
with open(file_name, 'w') as inputdb_file:
inputdb_file.write(template_str)
def check_for_deprecated_command(ctx_args):
"""
Temporary check raising an error message if the deprecated 'run-mc' command is used.
"""
import click
if len(ctx_args) > 1:
if "run-mc" in ctx_args:
message = "The command 'run-mc' is now deprecated. DaVinci can be run with './run davinci'"
raise Exception(f"{click.style(message, bold=True, fg='red')}")
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