From: Volker Theile Date: Mon, 15 Mar 2021 12:10:53 +0000 (+0100) Subject: mgr/dashboard: Python2 Cookie module import fails on Python3 X-Git-Tag: v14.2.18~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4b380d0d3b8302592f79e7f4b83204bac4792197;p=ceph.git mgr/dashboard: Python2 Cookie module import fails on Python3 This fix only affects Nautilus because all successor versions are based on Python3 only. Fixes: https://tracker.ceph.com/issues/49802 Signed-off-by: Volker Theile --- diff --git a/src/pybind/mgr/dashboard/controllers/auth.py b/src/pybind/mgr/dashboard/controllers/auth.py index 349b1c4ee72f..51139bef883e 100644 --- a/src/pybind/mgr/dashboard/controllers/auth.py +++ b/src/pybind/mgr/dashboard/controllers/auth.py @@ -1,7 +1,10 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import -import Cookie +try: + import Cookie +except ImportError: + import http.cookies as Cookie import sys import jwt