missed an argument

This commit is contained in:
2024-02-02 16:36:10 +01:00
committed by Auf keinen Fall Jens
parent 1be3fcf75e
commit 4529902bf1
3 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -149,7 +149,7 @@ class BrokerManager:
detector_name = request.get("detector_name", None)
validate.detector_name(detector_name)
validate.detector_name_in_allowed_detectors_beamline(detector_name, allowed_detectors_beamline)
validate.detector_name_in_allowed_detectors_beamline(detector_name, allowed_detectors_beamline, beamline)
request_power_on = {
"detector_name": detector_name,
@@ -245,7 +245,7 @@ class BrokerManager:
detectors = list(request["detectors"])
validate.detectors(detectors)
validate.all_detector_names_in_allowed_detectors_beamline(detectors, allowed_detectors_beamline)
validate.all_detector_names_in_allowed_detectors_beamline(detectors, allowed_detectors_beamline, beamline)
validate.request_has_pgroup(request)
pgroup = request["pgroup"]
@@ -388,7 +388,7 @@ class BrokerManager:
if detectors:
allowed_detectors_beamline = configured_detectors_for_beamline(beamline)
validate.allowed_detectors_beamline(allowed_detectors_beamline)
validate.all_detector_names_in_allowed_detectors_beamline(detectors, allowed_detectors_beamline)
validate.all_detector_names_in_allowed_detectors_beamline(detectors, allowed_detectors_beamline, beamline)
if "channels_list" in request:
request["channels_list"] = list(dict.fromkeys(request["channels_list"]))
+4 -4
View File
@@ -50,7 +50,7 @@ class DetectorManager:
detector_name = request.get("detector_name", None)
validate.detector_name(detector_name)
validate.detector_name_in_allowed_detectors_beamline(detector_name, allowed_detectors_beamline)
validate.detector_name_in_allowed_detectors_beamline(detector_name, allowed_detectors_beamline, beamline)
detector_number = int(detector_name[2:4])
detector = Jungfrau(detector_number)
@@ -84,7 +84,7 @@ class DetectorManager:
detector_name = request.get("detector_name", None)
validate.detector_name(detector_name)
validate.detector_name_in_allowed_detectors_beamline(detector_name, allowed_detectors_beamline)
validate.detector_name_in_allowed_detectors_beamline(detector_name, allowed_detectors_beamline, beamline)
detector_number = int(detector_name[2:4])
detector = Jungfrau(detector_number)
@@ -211,7 +211,7 @@ class DetectorManager:
detector_name = request.get("detector_name", None)
validate.detector_name(detector_name)
validate.detector_name_in_allowed_detectors_beamline(detector_name, allowed_detectors_beamline)
validate.detector_name_in_allowed_detectors_beamline(detector_name, allowed_detectors_beamline, beamline)
dap_parameters_file = f"/gpfs/photonics/swissfel/buffer/dap/config/pipeline_parameters.{detector_name}.json"
validate.dap_parameters_file_exists(dap_parameters_file)
@@ -234,7 +234,7 @@ class DetectorManager:
detector_name = request.get("detector_name", None)
validate.detector_name(detector_name)
validate.detector_name_in_allowed_detectors_beamline(detector_name, allowed_detectors_beamline)
validate.detector_name_in_allowed_detectors_beamline(detector_name, allowed_detectors_beamline, beamline)
dap_parameters_file = f"/gpfs/photonics/swissfel/buffer/dap/config/pipeline_parameters.{detector_name}.json"
validate.dap_parameters_file_exists(dap_parameters_file)
+4 -4
View File
@@ -63,13 +63,13 @@ def pgroup_is_not_closed(dd, ptp):
if os.path.exists(f"{dd}/CLOSED"):
raise RuntimeError(f"{ptp} is closed for writing")
def detector_name_in_allowed_detectors_beamline(dn, adb):
def detector_name_in_allowed_detectors_beamline(dn, adb, bl):
if dn not in adb:
raise RuntimeError(f"{dn} not belongs to the {beamline}")
raise RuntimeError(f"{dn} not belongs to the {bl}")
def all_detector_names_in_allowed_detectors_beamline(dns, adb):
def all_detector_names_in_allowed_detectors_beamline(dns, adb, bl):
for dn in dns:
detector_name_in_allowed_detectors_beamline(dn, adb)
detector_name_in_allowed_detectors_beamline(dn, adb, bl)
def request_has_detectors(req):
if "detectors" not in req: