@@ -1801,7 +1801,9 @@ def set_active_estimator(pioreactor_unit, device, estimator_name) -> DelayedResp
18011801 if pioreactor_unit == UNIVERSAL_IDENTIFIER :
18021802 task = broadcast_patch_across_workers (f"/unit_api/active_estimators/{ device } /{ estimator_name } " )
18031803 else :
1804- task = tasks .multicast_patch (f"/unit_api/active_estimators/{ device } /{ estimator_name } " , [pioreactor_unit ])
1804+ task = tasks .multicast_patch (
1805+ f"/unit_api/active_estimators/{ device } /{ estimator_name } " , [pioreactor_unit ]
1806+ )
18051807 return create_task_response (task )
18061808
18071809
@@ -1857,7 +1859,7 @@ def get_plugins_on_machine(pioreactor_unit: str) -> DelayedResponseReturnValue:
18571859@api_bp .route ("/units/<pioreactor_unit>/plugins/install" , methods = ["POST" , "PATCH" ])
18581860def install_plugin_across_cluster (pioreactor_unit : str ) -> DelayedResponseReturnValue :
18591861 # there is a security problem here. See https://github.com/Pioreactor/pioreactor/issues/421
1860- if os . path . isfile (Path (os .environ ["DOT_PIOREACTOR" ]) / "DISALLOW_UI_INSTALLS" ):
1862+ if (Path (os .environ ["DOT_PIOREACTOR" ]) / "DISALLOW_UI_INSTALLS" ). is_file ( ):
18611863 abort_with (403 , "Not UI installed allowed." )
18621864
18631865 if pioreactor_unit == UNIVERSAL_IDENTIFIER :
@@ -1872,7 +1874,7 @@ def install_plugin_across_cluster(pioreactor_unit: str) -> DelayedResponseReturn
18721874
18731875@api_bp .route ("/units/<pioreactor_unit>/plugins/uninstall" , methods = ["POST" , "PATCH" ])
18741876def uninstall_plugin_across_cluster (pioreactor_unit : str ) -> DelayedResponseReturnValue :
1875- if os . path . isfile (Path (os .environ ["DOT_PIOREACTOR" ]) / "DISALLOW_UI_INSTALLS" ):
1877+ if (Path (os .environ ["DOT_PIOREACTOR" ]) / "DISALLOW_UI_INSTALLS" ). is_file ( ):
18761878 abort_with (403 , "No UI uninstall allowed" )
18771879
18781880 if pioreactor_unit == UNIVERSAL_IDENTIFIER :
@@ -1954,7 +1956,7 @@ def get_app_versions(pioreactor_unit: str) -> DelayedResponseReturnValue:
19541956
19551957@api_bp .route ("/system/upload" , methods = ["POST" ])
19561958def upload () -> ResponseReturnValue :
1957- if os . path . isfile (Path (os .environ ["DOT_PIOREACTOR" ]) / "DISALLOW_UI_UPLOADS" ):
1959+ if (Path (os .environ ["DOT_PIOREACTOR" ]) / "DISALLOW_UI_UPLOADS" ). is_file ( ):
19581960 abort_with (403 , "No UI uploads allowed" )
19591961
19601962 if "file" not in request .files :
0 commit comments