=== modified file 'lava-dispatch'
@@ -24,7 +24,7 @@
import sys
import logging.config
-from linaro_json.schema import ValidationError
+from json_schema_validator.errors import ValidationError
from lava_dispatcher.job import LavaTestJob
from lava_dispatcher.config import get_config
@@ -39,6 +39,9 @@
parser.add_option(
"--validate", action='store_true',
help="Just validate the job file, do not execute any steps.")
+parser.add_option(
+ "--job-id", action='store', default=None,
+ help="Set the scheduler job identifier. This alters process name for easier debugging")
(options, args) = parser.parse_args()
@@ -61,6 +64,16 @@
DATEFMT= '%Y-%m-%d %I:%M:%S %p'
logging.basicConfig(format=FORMAT,datefmt=DATEFMT)
+# Set process id if job-id was passed to dispatcher
+if options.job_id:
+ try:
+ from setproctitle import getproctitle, setproctitle
+ except ImportError:
+ logging.warning("Unable to set import 'setproctitle', process name cannot be changed")
+ else:
+ setproctitle("%s [job: %s]" % (getproctitle(), options.job_id))
+
+
config = get_config("lava-dispatcher", options.config_dir)
logging_level = config.get("LOGGING_LEVEL")
logging.root.setLevel(int(logging_level))
=== modified file 'lava_dispatcher/job.py'
@@ -23,7 +23,8 @@
import pexpect
import traceback
-from linaro_json.schema import Schema, Validator
+from json_schema_validator.schema import Schema
+from json_schema_validator.validator import Validator
from lava_dispatcher.actions import get_all_cmds
from lava_dispatcher.client.base import CriticalError, GeneralError