Skip to content

Commit 560ba00

Browse files
committed
Make the dependency on the oci package clear when using the Cloud Service.
1 parent 02dba53 commit 560ba00

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/borneo/iam/iam.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ def __init__(self, provider=None, config_file=None, profile_name=None,
130130
raise IllegalArgumentException(
131131
'Access token cannot be cached longer than ' +
132132
str(SignatureProvider.MAX_ENTRY_LIFE_TIME) + ' seconds.')
133+
134+
#
135+
# This class depends on the oci package
136+
#
137+
if oci is None:
138+
raise ImportError('Package \'oci\' is required; please install')
139+
133140
try:
134141
if provider is not None:
135142
if not isinstance(
@@ -182,7 +189,7 @@ def __init__(self, provider=None, config_file=None, profile_name=None,
182189
tenant_id, user_id, fingerprint, key_file, pass_phrase,
183190
key_content)
184191
except AttributeError:
185-
raise ImportError('No module named oci')
192+
raise ImportError('Package \'oci\' is required; please install')
186193
self._signature_cache = Memoize(duration_seconds)
187194
self._refresh_interval_s = (duration_seconds - refresh_ahead if
188195
duration_seconds > refresh_ahead else 0)

0 commit comments

Comments
 (0)