File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,14 +92,14 @@ async def make_gif(
9292 output_file = sanitise_path (gif_params .output_file )
9393 if not output_file .is_relative_to (rsync_basepath ):
9494 logger .error ("Output file path is not permitted" )
95-
96- # Create the directory structure
97- if not ( output_dir := output_file . parent ). exists ():
98- output_dir . mkdir ( parents = True )
99- logger . debug ( f"Created output directory { output_dir } " )
100- visit_index = output_dir . parts . index ( visit_name )
101- # Change permissions for folders in the visit directory and onwards
102- for current_path in list ( reversed ( output_file . parents ))[ visit_index + 1 :]:
95+ raise ValueError
96+
97+ # Create folders in the visit directory and onwards and change permissions
98+ visit_index = output_file . parts . index ( visit_name )
99+ for current_path in list ( reversed ( output_file . parents ))[ visit_index + 1 :]:
100+ if not current_path . exists ():
101+ current_path . mkdir ( parents = True )
102+ logger . debug ( f"Created output directory { current_path } " )
103103 try :
104104 os .chmod (current_path , mode = machine_config .mkdir_chmod )
105105 except PermissionError :
You can’t perform that action at this time.
0 commit comments