diff --git a/distributed/http/scheduler/info.py b/distributed/http/scheduler/info.py index 48548a9275..a84a6a362f 100644 --- a/distributed/http/scheduler/info.py +++ b/distributed/http/scheduler/info.py @@ -33,6 +33,10 @@ logger = logging.getLogger(__name__) +API_ENABLED = "distributed.http.scheduler.api" in dask.config.get( + "distributed.scheduler.http.routes" +) + class Workers(RequestHandler): @log_errors @@ -41,8 +45,7 @@ def get(self): "workers.html", title="Workers", scheduler=self.server, - api_enabled="distributed.http.scheduler.api" - in dask.config.get("distributed.scheduler.http.routes"), + api_enabled=API_ENABLED, **merge( self.server.__dict__, self.server.__pdict__, @@ -65,6 +68,7 @@ def get(self, worker): "worker.html", title="Worker: " + worker, scheduler=self.server, + api_enabled=API_ENABLED, Worker=worker, **merge( self.server.__dict__, @@ -137,6 +141,7 @@ def get(self, task: str) -> None: title=f"Task: {key!r}", Task=key, scheduler=self.server, + api_enabled=API_ENABLED, **merge( self.server.__dict__, self.server.__pdict__,