]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Python2 Cookie module import fails on Python3 40116/head
authorVolker Theile <vtheile@suse.com>
Mon, 15 Mar 2021 12:10:53 +0000 (13:10 +0100)
committerVolker Theile <vtheile@suse.com>
Mon, 15 Mar 2021 12:10:53 +0000 (13:10 +0100)
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 <vtheile@suse.com>
src/pybind/mgr/dashboard/controllers/auth.py

index 349b1c4ee72f3bae474d5330c6c8a579eaa163f4..51139bef883ef20c189983f6033c106e9ae238a1 100644 (file)
@@ -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