Skip to content

Commit

Permalink
Merge pull request camptocamp#160 from sebalix/7.0-fix-attachment_swift
Browse files Browse the repository at this point in the history
[7.0][FIX] attachment_swift: fix imports (closes camptocamp#159)
  • Loading branch information
guewen authored Jun 22, 2020
2 parents 5f587bc + f3efd19 commit 1e69b6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions attachment_swift/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'external_dependencies': {
'python': ['swiftclient',
'keystoneclient',
'keystoneauth1',
],
},
'website': 'https://www.camptocamp.com',
Expand Down
5 changes: 4 additions & 1 deletion attachment_swift/models/ir_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
try:
import swiftclient
import keystoneauth1
from keystoneauth1 import identity
from swiftclient.exceptions import ClientException
except ImportError:
swiftclient = None
keystoneauth1 = None
identity = None
ClientException = None
_logger.debug("Cannot 'import swiftclient'.")

Expand Down Expand Up @@ -55,7 +58,7 @@ def get_session(self, auth_url=None, username=None, password=None,
key = self._get_key(auth_url, username, password, project_name)
session = self._sessions.get(key)
if not session:
auth = keystoneauth1.identity.v3.Password(
auth = identity.v3.Password(
username=username,
password=password,
project_name=project_name,
Expand Down

0 comments on commit 1e69b6e

Please sign in to comment.