10 """Create the configuration JSON file from the properties in `pkl_file`
11 and save it into `json_file`. If `createDBJson` then also create the
12 JSON file for database upload at P1."""
14 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
16 with open(pkl_file,
"rb")
as f:
19 if isinstance(cfg, ComponentAccumulator):
20 app_props, msg_props, comp_props = cfg.gatherProps()
21 props[
"ApplicationMgr"] = app_props
22 props[
"MessageSvc"] = msg_props
23 for comp, name, value
in comp_props:
24 props.setdefault(comp, {})[name] = value
30 hlt_json = {
'filetype' :
'joboptions'}
31 hlt_json[
'properties'] = props
34 with open(json_file,
"w")
as f:
35 json.dump(hlt_json, f, indent=4, sort_keys=
True, ensure_ascii=
True)
40 assert json_file[-5:] ==
".json"
41 db_file = json_file.replace(
".json",
".db.json")