mirror of
https://github.com/paulscherrerinstitute/sf_daq_broker.git
synced 2026-05-30 05:28:27 +02:00
removed daq_directory_exists in favour of using directory_exists consistently
This commit is contained in:
@@ -48,7 +48,7 @@ class BrokerManager:
|
||||
validate.path_to_pgroup_exists(path_to_pgroup)
|
||||
|
||||
daq_directory = f"{path_to_pgroup}{DIR_NAME_RUN_INFO}"
|
||||
validate.daq_directory_exists(daq_directory)
|
||||
validate.directory_exists(daq_directory)
|
||||
validate.pgroup_is_not_closed_yet(daq_directory, path_to_pgroup)
|
||||
|
||||
with open(f"{daq_directory}/CLOSED", "x"):
|
||||
@@ -127,7 +127,7 @@ class BrokerManager:
|
||||
validate.path_to_pgroup_exists(path_to_pgroup)
|
||||
|
||||
daq_directory = f"{path_to_pgroup}{DIR_NAME_RUN_INFO}"
|
||||
validate.daq_directory_exists(daq_directory)
|
||||
validate.directory_exists(daq_directory)
|
||||
|
||||
validate.pgroup_is_not_closed(daq_directory, path_to_pgroup)
|
||||
|
||||
@@ -260,7 +260,7 @@ class BrokerManager:
|
||||
validate.directory_exists(full_path)
|
||||
|
||||
daq_directory = f"{path_to_pgroup}{DIR_NAME_RUN_INFO}"
|
||||
validate.daq_directory_exists(daq_directory)
|
||||
validate.directory_exists(daq_directory)
|
||||
|
||||
validate.pgroup_is_not_closed(daq_directory, path_to_pgroup)
|
||||
|
||||
@@ -347,7 +347,7 @@ class BrokerManager:
|
||||
validate.path_to_pgroup_exists(path_to_pgroup)
|
||||
|
||||
daq_directory = f"{path_to_pgroup}{DIR_NAME_RUN_INFO}"
|
||||
validate.daq_directory_exists(daq_directory)
|
||||
validate.directory_exists(daq_directory)
|
||||
|
||||
if "run_number" not in request:
|
||||
request["run_number"] = get_current_run_number(daq_directory)
|
||||
|
||||
@@ -157,7 +157,7 @@ class DetectorManager:
|
||||
validate.path_to_pgroup_exists(path_to_pgroup)
|
||||
|
||||
daq_directory = f"{path_to_pgroup}/run_info"
|
||||
validate.daq_directory_exists(daq_directory)
|
||||
validate.directory_exists(daq_directory)
|
||||
validate.pgroup_is_not_closed_yet(daq_directory, path_to_pgroup)
|
||||
|
||||
run_number = request.get("run_number", None)
|
||||
|
||||
@@ -118,13 +118,6 @@ def run_dir_exists(lddr, rn):
|
||||
|
||||
# checks with side effects -- move somewhere else? refactor logic?
|
||||
|
||||
def daq_directory_exists(dd):
|
||||
if not os.path.exists(dd):
|
||||
try:
|
||||
os.mkdir(dd)
|
||||
except Exception as e:
|
||||
raise RuntimeError(f"no permission or possibility to make run_info directory in pgroup space (due to: {e})") from e
|
||||
|
||||
def directory_exists(pd):
|
||||
if not os.path.exists(pd):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user