diff --git a/attachment_s3/__openerp__.py b/attachment_s3/__openerp__.py index 253b075..f2c51db 100644 --- a/attachment_s3/__openerp__.py +++ b/attachment_s3/__openerp__.py @@ -6,7 +6,7 @@ {'name': 'Attachments on S3 storage', 'summary': 'Store assets and attachments on a S3 compatible object storage', 'version': '9.0.1.1.0', - 'author': 'Camptocamp', + 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Knowledge Management', 'depends': ['base'], diff --git a/attachment_s3/models/ir_attachment.py b/attachment_s3/models/ir_attachment.py index e39ae79..9bf1c42 100644 --- a/attachment_s3/models/ir_attachment.py +++ b/attachment_s3/models/ir_attachment.py @@ -10,16 +10,20 @@ import xml.dom.minidom from contextlib import closing, contextmanager from functools import partial - -import boto -from boto.exception import S3ResponseError - import openerp from openerp import _, api, exceptions, models, SUPERUSER_ID from ..s3uri import S3Uri _logger = logging.getLogger(__name__) +try: + import boto + from boto.exception import S3ResponseError +except ImportError: + boto = None # noqa + S3ResponseError = None # noqa + _logger.debug("Cannot 'import boto'.") + class IrAttachment(models.Model): _inherit = "ir.attachment" @@ -216,7 +220,8 @@ class IrAttachment(models.Model): elif attachment.db_datas: _logger.info('moving on the object storage from database') attachment.write({'datas': attachment.datas}) - new_env.cr.commit() + # we are in a new env, this is a valid commit + new_env.cr.commit() # pylint: disable=invalid-commit @contextmanager def do_in_new_env(self): @@ -237,7 +242,9 @@ class IrAttachment(models.Model): cr.rollback() raise else: - cr.commit() + # disable pylint error because this is a valid commit, + # we are in a new env + cr.commit() # pylint: disable=invalid-commit @api.model def force_storage(self): diff --git a/cloud_platform/__openerp__.py b/cloud_platform/__openerp__.py index ad9b54c..14400f1 100644 --- a/cloud_platform/__openerp__.py +++ b/cloud_platform/__openerp__.py @@ -6,7 +6,7 @@ {'name': 'Cloud Platform', 'summary': 'Addons required for the Camptocamp Cloud Platform', 'version': '9.0.1.0.0', - 'author': 'Camptocamp', + 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Extra Tools', 'depends': [ diff --git a/logging_json/__openerp__.py b/logging_json/__openerp__.py index 31bca57..e73ded2 100644 --- a/logging_json/__openerp__.py +++ b/logging_json/__openerp__.py @@ -4,7 +4,7 @@ {'name': 'JSON Logging', 'version': '9.0.1.0.0', - 'author': 'Camptocamp', + 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Extra Tools', 'depends': ['base', diff --git a/logging_json/json_log.py b/logging_json/json_log.py index 2f91915..3fcc796 100644 --- a/logging_json/json_log.py +++ b/logging_json/json_log.py @@ -6,7 +6,13 @@ import threading from distutils.util import strtobool -from pythonjsonlogger import jsonlogger +_logger = logging.getLogger(__name__) + +try: + from pythonjsonlogger import jsonlogger +except ImportError: + jsonlogger = None # noqa + _logger.debug("Cannot 'import pythonjsonlogger'.") def is_true(strval): diff --git a/monitoring_log_requests/__openerp__.py b/monitoring_log_requests/__openerp__.py index c09fba2..49e73e7 100644 --- a/monitoring_log_requests/__openerp__.py +++ b/monitoring_log_requests/__openerp__.py @@ -5,7 +5,7 @@ {'name': 'Monitoring: Requests Logging', 'version': '9.0.1.0.0', - 'author': 'Camptocamp', + 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'category', 'depends': ['base', 'web'], diff --git a/monitoring_status/__openerp__.py b/monitoring_status/__openerp__.py index 0e024c2..f64afb9 100644 --- a/monitoring_status/__openerp__.py +++ b/monitoring_status/__openerp__.py @@ -5,7 +5,7 @@ {'name': 'Monitoring: Status', 'version': '9.0.1.0.0', - 'author': 'Camptocamp', + 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'category', 'depends': ['base', 'web'], diff --git a/session_redis/__openerp__.py b/session_redis/__openerp__.py index 418cb60..3701910 100644 --- a/session_redis/__openerp__.py +++ b/session_redis/__openerp__.py @@ -6,7 +6,7 @@ {'name': 'Sessions in Redis', 'summary': 'Store web sessions in Redis', 'version': '9.0.1.0.0', - 'author': 'Camptocamp', + 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Extra Tools', 'depends': ['base'], diff --git a/session_redis/http.py b/session_redis/http.py index 4c814e8..a9c5ec0 100644 --- a/session_redis/http.py +++ b/session_redis/http.py @@ -7,8 +7,6 @@ import os from distutils.util import strtobool -import redis - import openerp from openerp import http from openerp.tools.func import lazy_property @@ -17,6 +15,12 @@ from .session import RedisSessionStore _logger = logging.getLogger(__name__) +try: + import redis +except ImportError: + redis = None # noqa + _logger.debug("Cannot 'import redis'.") + def is_true(strval): return bool(strtobool(strval or '0'.lower()))