mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 08:47:40 +00:00
[FIX] session_redis: fix flake8 errors
This commit is contained in:
@@ -1,4 +1,2 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from . import http
|
from . import http
|
||||||
from . import session
|
from . import session
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2016 Camptocamp SA
|
# Copyright 2016 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2016 Camptocamp SA
|
# Copyright 2016 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
@@ -79,15 +78,15 @@ def purge_fs_sessions(path):
|
|||||||
|
|
||||||
def copy_fs_sessions(path):
|
def copy_fs_sessions(path):
|
||||||
from odoo.http import OpenERPSession
|
from odoo.http import OpenERPSession
|
||||||
import werkzeug.contrib.sessions
|
from werkzeug.contrib.sessions import FilesystemSessionStore
|
||||||
werkzeug_session_store = werkzeug.contrib.sessions.FilesystemSessionStore(path, session_class=OpenERPSession)
|
werkzeug_session_store = FilesystemSessionStore(path, session_class=OpenERPSession)
|
||||||
session_store = http.Root().session_store
|
session_store = http.Root().session_store
|
||||||
filename_prefix='werkzeug_'
|
filename_prefix_len = len('werkzeug_')
|
||||||
filename_suffix = '.sess'
|
filename_suffix_len = len('.sess')
|
||||||
|
|
||||||
for fname in os.listdir(path):
|
for fname in os.listdir(path):
|
||||||
path = os.path.join(path, fname)
|
session_file = fname[filename_prefix_len:filename_suffix_len * -1]
|
||||||
session = werkzeug_session_store.get(fname[len(filename_prefix):len(filename_suffix) * -1])
|
session = werkzeug_session_store.get(session_file)
|
||||||
session_store.save(session)
|
session_store.save(session)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2016 Camptocamp SA
|
# Copyright 2016 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user