Skip to content

Commit

Permalink
fix(agent): fix werkzeug.middleware mod not found
Browse files Browse the repository at this point in the history
In Werkzeug < 0.15, dispatcher was not in a dedicated module. It was
included in a big wsgi module before it was splitted. This old version
of werkzeug must be fully supported though because it is included in
el8.

fix #419
  • Loading branch information
rezib committed Jan 2, 2025
1 parent 0dedbc8 commit 4bed033
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- docs: Update configuration reference documentation.

### Fixed
- agent: Fix No module named 'werkzeug.middleware' ModuleNotFoundError with
Werkzeug < 0.15 (#419→420).
- frontend: Update dependencies to fix CVE-2024-55565 (nanoid).

## [4.0.0] - 2024-11-28
Expand Down
10 changes: 9 additions & 1 deletion slurmweb/apps/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
from rfl.web.tokens import RFLTokenizedRBACWebApp
from racksdb.errors import RacksDBSchemaError, RacksDBFormatError
from racksdb.web.app import RacksDBWebBlueprint
from werkzeug.middleware import dispatcher

try:
from werkzeug.middleware import dispatcher
except ModuleNotFoundError:
# In Werkzeug < 0.15, dispatcher was not in a dedicated module, it was included in a
# big wsgi module. This old version of werkzeug must be fully supported because it
# is included in el8. See https://github.com/rackslab/Slurm-web/issues/419 for
# reference.
from werkzeug import wsgi as dispatcher

from . import SlurmwebWebApp
from ..version import get_version
Expand Down

0 comments on commit 4bed033

Please sign in to comment.