{"action":"created","comment":{"url":"https://api.github.com/repos/odoo/odoo/pulls/comments/52307450","id":52307450,"diff_hunk":"@@ -1328,9 +1329,32 @@ def __init__(self):\n     @lazy_property\n     def session_store(self):\n         # Setup http sessions\n-        path = openerp.tools.config.session_dir\n-        _logger.debug('HTTP sessions stored in: %s', path)\n-        return werkzeug.contrib.sessions.FilesystemSessionStore(path, session_class=OpenERPSession)\n+        if 'session_store' in openerp.tools.config.options and \\\n+                openerp.tools.config['session_store']:\n+            module_name = '.'.join(\n+                openerp.tools.config['session_store'].split('.')[:-1])\n+            class_name = '.'.join(\n+                openerp.tools.config['session_store'].split('.')[-1:])\n+\n+            try:\n+                module_ = importlib.import_module(module_name)\n+                try:\n+                    class_ = getattr(module_, class_name)\n+                except AttributeError:\n+                    raise exceptions.UserError(\n+                        'Class of session store not found: %s' % class_name)\n+                session_store = class_(session_class=OpenERPSession)\n+                _logger.debug('HTTP sessions stored via: %s',\n+                              openerp.tools.config['session_store'])\n+            except ImportError:\n+                raise exceptions.UserError(\n+                    'Module of session store not found: %s' % module_name)\n+        else:\n+            path = openerp.tools.config.session_dir","path":"openerp/http.py","position":44,"original_position":45,"commit_id":"f7338e6f3a20a1477bef1731cf7b0c8f31eddef1","original_commit_id":"1b814e38c677364100ef32ede8b2354fcd2456d3","user":{"login":"christophlsa","id":115873,"avatar_url":"https://avatars.githubusercontent.com/u/115873?v=3","gravatar_id":"","url":"https://api.github.com/users/christophlsa","html_url":"https://github.com/christophlsa","followers_url":"https://api.github.com/users/christophlsa/followers","following_url":"https://api.github.com/users/christophlsa/following{/other_user}","gists_url":"https://api.github.com/users/christophlsa/gists{/gist_id}","starred_url":"https://api.github.com/users/christophlsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophlsa/subscriptions","organizations_url":"https://api.github.com/users/christophlsa/orgs","repos_url":"https://api.github.com/users/christophlsa/repos","events_url":"https://api.github.com/users/christophlsa/events{/privacy}","received_events_url":"https://api.github.com/users/christophlsa/received_events","type":"User","site_admin":false},"body":"I don't get the point. What's the problem here?","created_at":"2016-02-09T13:36:44Z","updated_at":"2016-02-09T13:36:44Z","html_url":"https://github.com/odoo/odoo/pull/7937#discussion_r52307450","pull_request_url":"https://api.github.com/repos/odoo/odoo/pulls/7937","_links":{"self":{"href":"https://api.github.com/repos/odoo/odoo/pulls/comments/52307450"},"html":{"href":"https://github.com/odoo/odoo/pull/7937#discussion_r52307450"},"pull_request":{"href":"https://api.github.com/repos/odoo/odoo/pulls/7937"}}},"pull_request":{"url":"https://api.github.com/repos/odoo/odoo/pulls/7937","id":41795659,"html_url":"https://github.com/odoo/odoo/pull/7937","diff_url":"https://github.com/odoo/odoo/pull/7937.diff","patch_url":"https://github.com/odoo/odoo/pull/7937.patch","issue_url":"https://api.github.com/repos/odoo/odoo/issues/7937","number":7937,"state":"open","locked":false,"title":"[ADD] ability to define own session store class","user":{"login":"christophlsa","id":115873,"avatar_url":"https://avatars.githubusercontent.com/u/115873?v=3","gravatar_id":"","url":"https://api.github.com/users/christophlsa","html_url":"https://github.com/christophlsa","followers_url":"https://api.github.com/users/christophlsa/followers","following_url":"https://api.github.com/users/christophlsa/following{/other_user}","gists_url":"https://api.github.com/users/christophlsa/gists{/gist_id}","starred_url":"https://api.github.com/users/christophlsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophlsa/subscriptions","organizations_url":"https://api.github.com/users/christophlsa/orgs","repos_url":"https://api.github.com/users/christophlsa/repos","events_url":"https://api.github.com/users/christophlsa/events{/privacy}","received_events_url":"https://api.github.com/users/christophlsa/received_events","type":"User","site_admin":false},"body":"Hey there,\r\n\r\ncurrently odoo uses the `FilesystemSessionStore` of werkzeug to save and manage the user sessions. If you want to run more than one odoo instance on different machines you have to use a shared filesystem. To avoid these you want to save the session in the database or another servers. Other tools allow to define a specific session store. With this commit I add the ability to define the class to use.\r\n\r\nWith this change you can set the config option `session_store` to the class of the session store (with the python module path). Also you can set this class via the option `--session-store`.\r\n\r\nWhy I did this in the core: First I created a new addon which replaces the `session_store`. But this overwritings are only loaded if the module is already installed and the database is set via the commandline or config. If the module is installed or the database is picked by the selection in the browser then the function is already loaded and the overwriting doesn't work anymore. [See my question in odoo forum.](https://www.odoo.com/fr_FR/forum/help-1/question/replace-session-store-of-odoo-werkzeug-86843)","created_at":"2015-08-06T14:44:52Z","updated_at":"2016-02-09T13:36:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3e63c70aa6233ff9af52dfffb5015211ed05039","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/odoo/odoo/pulls/7937/commits","review_comments_url":"https://api.github.com/repos/odoo/odoo/pulls/7937/comments","review_comment_url":"https://api.github.com/repos/odoo/odoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/7937/comments","statuses_url":"https://api.github.com/repos/odoo/odoo/statuses/f7338e6f3a20a1477bef1731cf7b0c8f31eddef1","head":{"label":"christophlsa:master_feature_session_storage","ref":"master_feature_session_storage","sha":"f7338e6f3a20a1477bef1731cf7b0c8f31eddef1","user":{"login":"christophlsa","id":115873,"avatar_url":"https://avatars.githubusercontent.com/u/115873?v=3","gravatar_id":"","url":"https://api.github.com/users/christophlsa","html_url":"https://github.com/christophlsa","followers_url":"https://api.github.com/users/christophlsa/followers","following_url":"https://api.github.com/users/christophlsa/following{/other_user}","gists_url":"https://api.github.com/users/christophlsa/gists{/gist_id}","starred_url":"https://api.github.com/users/christophlsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophlsa/subscriptions","organizations_url":"https://api.github.com/users/christophlsa/orgs","repos_url":"https://api.github.com/users/christophlsa/repos","events_url":"https://api.github.com/users/christophlsa/events{/privacy}","received_events_url":"https://api.github.com/users/christophlsa/received_events","type":"User","site_admin":false},"repo":{"id":36723266,"name":"odoo","full_name":"christophlsa/odoo","owner":{"login":"christophlsa","id":115873,"avatar_url":"https://avatars.githubusercontent.com/u/115873?v=3","gravatar_id":"","url":"https://api.github.com/users/christophlsa","html_url":"https://github.com/christophlsa","followers_url":"https://api.github.com/users/christophlsa/followers","following_url":"https://api.github.com/users/christophlsa/following{/other_user}","gists_url":"https://api.github.com/users/christophlsa/gists{/gist_id}","starred_url":"https://api.github.com/users/christophlsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophlsa/subscriptions","organizations_url":"https://api.github.com/users/christophlsa/orgs","repos_url":"https://api.github.com/users/christophlsa/repos","events_url":"https://api.github.com/users/christophlsa/events{/privacy}","received_events_url":"https://api.github.com/users/christophlsa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/christophlsa/odoo","description":"Odoo (formerly OpenERP). Open Source Apps To Grow Your Business.","fork":true,"url":"https://api.github.com/repos/christophlsa/odoo","forks_url":"https://api.github.com/repos/christophlsa/odoo/forks","keys_url":"https://api.github.com/repos/christophlsa/odoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/christophlsa/odoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/christophlsa/odoo/teams","hooks_url":"https://api.github.com/repos/christophlsa/odoo/hooks","issue_events_url":"https://api.github.com/repos/christophlsa/odoo/issues/events{/number}","events_url":"https://api.github.com/repos/christophlsa/odoo/events","assignees_url":"https://api.github.com/repos/christophlsa/odoo/assignees{/user}","branches_url":"https://api.github.com/repos/christophlsa/odoo/branches{/branch}","tags_url":"https://api.github.com/repos/christophlsa/odoo/tags","blobs_url":"https://api.github.com/repos/christophlsa/odoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/christophlsa/odoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/christophlsa/odoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/christophlsa/odoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/christophlsa/odoo/statuses/{sha}","languages_url":"https://api.github.com/repos/christophlsa/odoo/languages","stargazers_url":"https://api.github.com/repos/christophlsa/odoo/stargazers","contributors_url":"https://api.github.com/repos/christophlsa/odoo/contributors","subscribers_url":"https://api.github.com/repos/christophlsa/odoo/subscribers","subscription_url":"https://api.github.com/repos/christophlsa/odoo/subscription","commits_url":"https://api.github.com/repos/christophlsa/odoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/christophlsa/odoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/christophlsa/odoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/christophlsa/odoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/christophlsa/odoo/contents/{+path}","compare_url":"https://api.github.com/repos/christophlsa/odoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/christophlsa/odoo/merges","archive_url":"https://api.github.com/repos/christophlsa/odoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/christophlsa/odoo/downloads","issues_url":"https://api.github.com/repos/christophlsa/odoo/issues{/number}","pulls_url":"https://api.github.com/repos/christophlsa/odoo/pulls{/number}","milestones_url":"https://api.github.com/repos/christophlsa/odoo/milestones{/number}","notifications_url":"https://api.github.com/repos/christophlsa/odoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/christophlsa/odoo/labels{/name}","releases_url":"https://api.github.com/repos/christophlsa/odoo/releases{/id}","deployments_url":"https://api.github.com/repos/christophlsa/odoo/deployments","created_at":"2015-06-02T09:39:06Z","updated_at":"2015-06-02T09:39:56Z","pushed_at":"2016-02-09T13:32:08Z","git_url":"git://github.com/christophlsa/odoo.git","ssh_url":"git@github.com:christophlsa/odoo.git","clone_url":"https://github.com/christophlsa/odoo.git","svn_url":"https://github.com/christophlsa/odoo","homepage":"https://www.odoo.com","size":1145284,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"8.0"}},"base":{"label":"odoo:master","ref":"master","sha":"52193c4953f4108dee5eafef0dd40c1f466946ef","user":{"login":"odoo","id":6368483,"avatar_url":"https://avatars.githubusercontent.com/u/6368483?v=3","gravatar_id":"","url":"https://api.github.com/users/odoo","html_url":"https://github.com/odoo","followers_url":"https://api.github.com/users/odoo/followers","following_url":"https://api.github.com/users/odoo/following{/other_user}","gists_url":"https://api.github.com/users/odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo/subscriptions","organizations_url":"https://api.github.com/users/odoo/orgs","repos_url":"https://api.github.com/users/odoo/repos","events_url":"https://api.github.com/users/odoo/events{/privacy}","received_events_url":"https://api.github.com/users/odoo/received_events","type":"Organization","site_admin":false},"repo":{"id":19745004,"name":"odoo","full_name":"odoo/odoo","owner":{"login":"odoo","id":6368483,"avatar_url":"https://avatars.githubusercontent.com/u/6368483?v=3","gravatar_id":"","url":"https://api.github.com/users/odoo","html_url":"https://github.com/odoo","followers_url":"https://api.github.com/users/odoo/followers","following_url":"https://api.github.com/users/odoo/following{/other_user}","gists_url":"https://api.github.com/users/odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo/subscriptions","organizations_url":"https://api.github.com/users/odoo/orgs","repos_url":"https://api.github.com/users/odoo/repos","events_url":"https://api.github.com/users/odoo/events{/privacy}","received_events_url":"https://api.github.com/users/odoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odoo/odoo","description":"Odoo (formerly OpenERP). Open Source Apps To Grow Your Business.","fork":false,"url":"https://api.github.com/repos/odoo/odoo","forks_url":"https://api.github.com/repos/odoo/odoo/forks","keys_url":"https://api.github.com/repos/odoo/odoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odoo/odoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odoo/odoo/teams","hooks_url":"https://api.github.com/repos/odoo/odoo/hooks","issue_events_url":"https://api.github.com/repos/odoo/odoo/issues/events{/number}","events_url":"https://api.github.com/repos/odoo/odoo/events","assignees_url":"https://api.github.com/repos/odoo/odoo/assignees{/user}","branches_url":"https://api.github.com/repos/odoo/odoo/branches{/branch}","tags_url":"https://api.github.com/repos/odoo/odoo/tags","blobs_url":"https://api.github.com/repos/odoo/odoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odoo/odoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odoo/odoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/odoo/odoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odoo/odoo/statuses/{sha}","languages_url":"https://api.github.com/repos/odoo/odoo/languages","stargazers_url":"https://api.github.com/repos/odoo/odoo/stargazers","contributors_url":"https://api.github.com/repos/odoo/odoo/contributors","subscribers_url":"https://api.github.com/repos/odoo/odoo/subscribers","subscription_url":"https://api.github.com/repos/odoo/odoo/subscription","commits_url":"https://api.github.com/repos/odoo/odoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/odoo/odoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/odoo/odoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/odoo/odoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/odoo/odoo/contents/{+path}","compare_url":"https://api.github.com/repos/odoo/odoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odoo/odoo/merges","archive_url":"https://api.github.com/repos/odoo/odoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odoo/odoo/downloads","issues_url":"https://api.github.com/repos/odoo/odoo/issues{/number}","pulls_url":"https://api.github.com/repos/odoo/odoo/pulls{/number}","milestones_url":"https://api.github.com/repos/odoo/odoo/milestones{/number}","notifications_url":"https://api.github.com/repos/odoo/odoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odoo/odoo/labels{/name}","releases_url":"https://api.github.com/repos/odoo/odoo/releases{/id}","deployments_url":"https://api.github.com/repos/odoo/odoo/deployments","created_at":"2014-05-13T15:38:58Z","updated_at":"2016-02-09T10:54:41Z","pushed_at":"2016-02-09T13:34:39Z","git_url":"git://github.com/odoo/odoo.git","ssh_url":"git@github.com:odoo/odoo.git","clone_url":"https://github.com/odoo/odoo.git","svn_url":"https://github.com/odoo/odoo","homepage":"https://www.odoo.com","size":1346508,"stargazers_count":3758,"watchers_count":3758,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3482,"mirror_url":null,"open_issues_count":3096,"forks":3482,"open_issues":3096,"watchers":3758,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/odoo/odoo/pulls/7937"},"html":{"href":"https://github.com/odoo/odoo/pull/7937"},"issue":{"href":"https://api.github.com/repos/odoo/odoo/issues/7937"},"comments":{"href":"https://api.github.com/repos/odoo/odoo/issues/7937/comments"},"review_comments":{"href":"https://api.github.com/repos/odoo/odoo/pulls/7937/comments"},"review_comment":{"href":"https://api.github.com/repos/odoo/odoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/odoo/odoo/pulls/7937/commits"},"statuses":{"href":"https://api.github.com/repos/odoo/odoo/statuses/f7338e6f3a20a1477bef1731cf7b0c8f31eddef1"}}}}