Merge pull request #160 from sebalix/7.0-fix-attachment_swift

[7.0][FIX] attachment_swift: fix imports (closes #159)
This commit is contained in:
Guewen Baconnier
2020-06-22 07:44:44 +02:00
committed by GitHub
co-authored by GitHub
2 changed files with 5 additions and 1 deletions
+1
View File
@@ -13,6 +13,7 @@
'external_dependencies': {
'python': ['swiftclient',
'keystoneclient',
'keystoneauth1',
],
},
'website': 'https://www.camptocamp.com',
+4 -1
View File
@@ -17,9 +17,12 @@ _logger = logging.getLogger(__name__)
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'.")
@@ -55,7 +58,7 @@ class SwiftSessionStore(object):
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,