mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 08:47:40 +00:00
[FIX] attachment_swift: fix imports
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
'external_dependencies': {
|
'external_dependencies': {
|
||||||
'python': ['swiftclient',
|
'python': ['swiftclient',
|
||||||
'keystoneclient',
|
'keystoneclient',
|
||||||
|
'keystoneauth1',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'website': 'https://www.camptocamp.com',
|
'website': 'https://www.camptocamp.com',
|
||||||
|
|||||||
@@ -17,9 +17,12 @@ _logger = logging.getLogger(__name__)
|
|||||||
try:
|
try:
|
||||||
import swiftclient
|
import swiftclient
|
||||||
import keystoneauth1
|
import keystoneauth1
|
||||||
|
from keystoneauth1 import identity
|
||||||
from swiftclient.exceptions import ClientException
|
from swiftclient.exceptions import ClientException
|
||||||
except ImportError:
|
except ImportError:
|
||||||
swiftclient = None
|
swiftclient = None
|
||||||
|
keystoneauth1 = None
|
||||||
|
identity = None
|
||||||
ClientException = None
|
ClientException = None
|
||||||
_logger.debug("Cannot 'import swiftclient'.")
|
_logger.debug("Cannot 'import swiftclient'.")
|
||||||
|
|
||||||
@@ -55,7 +58,7 @@ class SwiftSessionStore(object):
|
|||||||
key = self._get_key(auth_url, username, password, project_name)
|
key = self._get_key(auth_url, username, password, project_name)
|
||||||
session = self._sessions.get(key)
|
session = self._sessions.get(key)
|
||||||
if not session:
|
if not session:
|
||||||
auth = keystoneauth1.identity.v3.Password(
|
auth = identity.v3.Password(
|
||||||
username=username,
|
username=username,
|
||||||
password=password,
|
password=password,
|
||||||
project_name=project_name,
|
project_name=project_name,
|
||||||
|
|||||||
Reference in New Issue
Block a user