Commit Graph
116 Commits
Author SHA1 Message Date
Guewen Baconnier b45b4d23a9 Override dependencies with different name and pin versions
The name of the libs and python packages are different, Odoo expects
the inner python package in the manifest, but setuptools cannot find the
libs in pypi, overrides them with the libs names.
2019-05-09 10:10:36 +02:00
Guewen Baconnier fe827e6b3f Pin PyYAML version because 5.x does not work with Odoo
It would raise ConstructorError: could not determine a constructor for the tag '!record'
2019-05-09 10:10:36 +02:00
Guewen Baconnier 8a4e9d1f84 attachment_swift: share a session for all connections
OVH's Swift applies a rate limit on the authentication.

attachment_swift authenticates again each time it has to read/write an
attachment. When running upgrades on upgrades of files or installing a
new DB, at some point, we get rejected with HTTP 429.

This commit introduces a shared storage for Swift Session. All
connections will reuses the same authentication token created the first
time a connection needs a Session.

Note: needs python-swiftclient>=3.7.0 to have
https://github.com/openstack/python-swiftclient/commit/1971ef880ff225379d4a91f00f89f323a1605eeb
2019-05-09 10:10:36 +02:00
Guewen Baconnier 440600e89f Add missing variable in documentation example 2019-05-09 10:04:45 +02:00
Guewen BaconnierandGitHub 2dff3e9676 Merge pull request #44 from Numigi/11.0-monitoring_log_requests_dispatch_classmethod
monitoring_log_request: _dispatch is a classmethod
2019-02-12 08:25:57 +01:00
Jordi Riera 535c658b70 monitorin_log_request: _dispatch is a classmethod 2019-02-11 17:46:04 -05:00
Guewen BaconnierandGitHub 1e310e34a8 Merge pull request #42 from tschanzt/allow_more_bucket_names
allow more bucket names
2019-01-14 16:27:31 +01:00
Timon Tschanz 4110f98480 set boto cfg 2019-01-07 17:17:34 +01:00
Timon Tschanz 26911b3bf3 allow more bucket names 2018-12-11 14:03:29 +01:00
Guewen Baconnier bdde32b3b8 Add setuptools files 2018-12-03 10:07:58 +01:00
Guewen Baconnier 636af1884f Edit readme 2018-12-03 10:07:07 +01:00
Guewen Baconnier 96f4e75311 base_attachment_object_storage: bump 1.1.0 2018-06-13 17:25:21 +02:00
Guewen BaconnierandGitHub 19dcbff646 Merge pull request #35 from guewen/11.0-force-storage-at-upgrade
11.0 Fix attachments stored in FS instead of object storage
2018-06-13 17:24:50 +02:00
Guewen Baconnier 371e5439e6 Document a weird domain which is there for a reason
The reason being:
https://github.com/odoo/odoo/blob/9032617120138848c63b3cfa5d1913c5e5ad76db/odoo/addons/base/ir/ir_attachment.py#L344-L347

I nearly deleted this domain but it was too weird to be there for no
reason. A comment explaining the issue was really missing.
2018-06-13 16:05:34 +02:00
Guewen Baconnier 6ab3038a90 Fix attachments stored in FS instead of object storage
Assume the following situation:

* We have installed addons base, sale and attachment_s3 (hence
base_attachment_object_storage as dependency)
* All attachments are in S3 already
* We run an upgrade of the 'base' addon, 'sale' is upgraded before
attachment_s3 in the order of loading.
* Sale updates the icon of the Sale menu
* As attachment_s3 is not loaded yet, the attachment is created in the
filestore

Now if we don't persist the filestore or use different servers, we'll
lose the images of the menus (or any attachment loaded by the
install/upgrade of an addon).

The implemented solution is to move the attachments from the filestore
to the object storage at the loading of the module. However, this
operation can take time and it shouldn't be run by 2 processes at the
same time, so we want to detect if the module is loaded during a normal odoo
startup or when some addons have been upgraded. There is nothing anymore
at this point which allow us to know that modules just have been
upgraded except... in the caller frame (load_modules). We have to rely
on the inpect module and get the caller frame, which is not recommended,
but seems the only way, besides, it's not called often and if
_register_hook was called from another place, it would have no effect
(unless the other place has a variable 'update_module' too).
2018-06-13 16:05:26 +02:00
Guewen Baconnier fb3d3134d6 Ensure that migration of files is commited before deleting files
When moving attachments from the filestore to an object storage,  the
filesystem files will be deleted only after the commit, so if the
transaction is rollbacked, we still have the local files for another
try.
2018-06-13 16:04:55 +02:00
Guewen BaconnierandGitHub 2ec125cccd Merge pull request #31 from guewen/11.0-swift-pass-region-name
Propagage region_name to swift connection
2018-03-29 16:44:39 +02:00
Guewen Baconnier 529c4066fa Propagage region_name to swift connection
Otherwise, the bucket will be in the incorrect region
2018-03-16 09:10:58 +01:00
Guewen BaconnierandGitHub c35483d948 Merge pull request #29 from guewen/11.0-fix-redis-stored-log
Fix order of args in logs
2018-03-15 12:27:47 +01:00
Guewen Baconnier 543a9eb22d Fix order of args in logs 2018-03-13 15:00:26 +01:00
Guewen BaconnierandGitHub 68c161e345 Merge pull request #28 from camptocamp/yvaucher-patch-1
Remove useless call to lower()
2018-02-08 15:32:14 +01:00
Yannick VaucherandGitHub 78d99ff330 Remove useless call to lower()
'0'.lower() == '0'
2018-02-08 14:49:15 +01:00
jcouxandGitHub 5706146f18 Merge pull request #27 from jcoux/1093_v11_monitoring-short-living-sessions
Expire sessions generated by health checks quickly
2018-01-11 11:19:16 +01:00
Guewen Baconnierandjcoux 39e71ff334 Expire sessions generated by health checks quickly
The default expiration of sessions is 7 days. With healthchecks run
every few seconds, we quickly have millions of anonymous sessions in
Redis. Allow to define a custom expiration for some sessions and set a
very short one for the monitoring requests.
2018-01-11 10:46:55 +01:00
jcouxandGuewen Baconnier 8eaa15df7b [11.0] Fix connection errors when we read attachment 2018-01-11 10:41:26 +01:00
Guewen Baconnier e3799cd54b Change OCA dependency to server-env
server_environment addons have been moved there
2018-01-11 10:41:26 +01:00
Yannick VaucherandGuewen Baconnier a3abfca6c5 Don't try to decode None when key was removed from database 2018-01-11 10:41:26 +01:00
Guewen Baconnier 6cc18007dd Remove web_kanban, does no longer exist in 11.0 2018-01-11 10:41:26 +01:00
Guewen Baconnier bfaca4628a Tentative to fix travis build 2018-01-11 10:41:26 +01:00
Guewen Baconnier 5b37af2376 Fix flake8 warning 2018-01-11 10:41:26 +01:00
Guewen Baconnier 207cd6504c Encode/decode redis data which expects bytes 2017-11-15 16:25:02 +01:00
Guewen Baconnier ea44b4fd15 Remove call to encode, str expected, not bytes (py3) 2017-11-15 16:15:39 +01:00
Guewen Baconnier 08329c91d2 Replace value.decode('base64') by base64.b64decode (py3) 2017-11-15 15:54:59 +01:00
Guewen Baconnier 5901ca82a2 Set version in .travis.yml 2017-11-15 15:42:25 +01:00
Guewen Baconnier 4bb649f729 Add check for empty bucket on integration 2017-11-15 15:03:03 +01:00
Guewen Baconnier b084ce278a Set addons installable 2017-11-15 14:56:45 +01:00
Guewen Baconnier f9c290a45a Apply 2to3 automatic migration 2017-11-15 14:55:11 +01:00
Guewen Baconnier 96c9a38150 Set addons uninstallable 2017-11-15 14:31:23 +01:00
Guewen BaconnierandGitHub 98d7bc3096 Merge pull request #19 from yvaucher/aws-region
Add AWS_REGION to connect to bucket with specific region
2017-11-15 14:28:54 +01:00
Yannick Vaucher a3c0322982 Add AWS_REGION to connect to bucket with specific region 2017-11-13 16:29:01 +01:00
Guewen BaconnierandGitHub aaf56d5027 Merge pull request #18 from TDu/mock-test-swift
Mock Swift client api in tests
2017-11-10 09:00:38 +01:00
Guewen Baconnier 7999386273 Fix tests
When there is no write container setup, no write/delete actions are
done.
2017-11-10 08:52:53 +01:00
Thierry Ducrest d79646d108 Add mocking in Swift tests 2017-11-09 11:33:36 +01:00
jcouxandGitHub 0fe1115bc9 Merge pull request #17 from camptocamp/jcoux-patch-fix-regex-redis
Fix regex on check ODOO_SESSION_REDIS_PREFIX
2017-10-26 13:21:48 +02:00
jcoux 55631073b1 Fix regex on check ODOO_SESSION_REDIS_PREFIX 2017-10-26 12:29:41 +02:00
Guewen BaconnierandGitHub 86e5bd3ad7 Merge pull request #16 from TDu/add-ovh-platform
[BSRTL-215] Add OVH as an option for the cloud platform
2017-09-21 09:03:46 +02:00
Guewen Baconnier ee8038b388 Update doc 2017-09-20 15:42:25 +02:00
Guewen Baconnier abe34fcaa2 Return empty result on file read error
This is how the core implementation works
2017-09-20 15:42:25 +02:00
Guewen Baconnier cbef735c76 Abstract object storage in attachment_s3
Using the base_attachment_object_storage module, the same way
attachment_swift is done. Fixed a few issues along the way in
attachment_swift.
2017-09-20 15:42:25 +02:00
Guewen Baconnier edc700c807 Configure storage by platform kind 2017-09-20 15:42:25 +02:00