Skip to content

Commit dbe14d8

Browse files
Raise NotImplementedError on unavailable functionality
Closes #17
1 parent c439330 commit dbe14d8

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

gssapi/creds.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ def __new__(cls, base=None, token=None,
5252
base_creds = base
5353
elif token is not None:
5454
if rcred_imp_exp is None:
55-
raise AttributeError("Your GSSAPI implementation does not "
56-
"have support for importing and "
57-
"exporting creditials")
55+
raise NotImplementedError("Your GSSAPI implementation does "
56+
"not have support for importing and "
57+
"exporting creditials")
5858

5959
base_creds = rcred_imp_exp.import_cred(token)
6060
else:
@@ -128,9 +128,9 @@ def acquire(cls, desired_name=None, lifetime=None,
128128
desired_mechs, usage)
129129
else:
130130
if rcred_cred_store is None:
131-
raise AttributeError("Your GSSAPI implementation does not "
132-
"have support for manipulating "
133-
"credential stores")
131+
raise NotImplementedError("Your GSSAPI implementation does "
132+
"not have support for manipulating "
133+
"credential stores")
134134

135135
store = _encode_dict(store)
136136

@@ -167,16 +167,16 @@ def store(self, store=None, usage='both', mech=None,
167167

168168
if store is None:
169169
if rcred_rfc5588 is None:
170-
raise AttributeError("Your GSSAPI implementation does not "
171-
"have support for RFC 5588")
170+
raise NotImplementedError("Your GSSAPI implementation does "
171+
"not have support for RFC 5588")
172172

173173
return rcred_cred_store.store_cred(self, usage, mech,
174174
overwrite, set_default)
175175
else:
176176
if rcred_cred_store is None:
177-
raise AttributeError("Your GSSAPI implementation does not "
178-
"have support for manipulating "
179-
"credential stores directly")
177+
raise NotImplementedError("Your GSSAPI implementation does "
178+
"not have support for manipulating "
179+
"credential stores directly")
180180

181181
store = _encode_dict(store)
182182

@@ -206,8 +206,8 @@ def impersonate(self, desired_name=None, lifetime=None,
206206
"""
207207

208208
if rcred_s4u is None:
209-
raise AttributeError("Your GSSAPI implementation does not "
210-
"have support for S4U")
209+
raise NotImplementedError("Your GSSAPI implementation does not "
210+
"have support for S4U")
211211

212212
res = rcred_s4u.acquire_cred_impersonate_name(self, desired_name,
213213
lifetime, desired_mechs,
@@ -310,8 +310,8 @@ def add(self, desired_name, desired_mech, usage='both',
310310

311311
if impersonator is not None:
312312
if rcred_s4u is None:
313-
raise AttributeError("Your GSSAPI implementation does not "
314-
"have support for S4U")
313+
raise NotImplementedError("Your GSSAPI implementation does "
314+
"not have support for S4U")
315315
res = rcred_s4u.add_cred_impersonate_name(self, impersonator,
316316
desired_name,
317317
desired_mech,
@@ -336,9 +336,9 @@ def export(self):
336336
"""
337337

338338
if rcred_imp_exp is None:
339-
raise AttributeError("Your GSSAPI implementation does not "
340-
"have support for importing and exporting "
341-
"creditials")
339+
raise NotImplementedError("Your GSSAPI implementation does not "
340+
"have support for importing and "
341+
"exporting creditials")
342342

343343
return rcred_imp_exp.export_cred(self)
344344

0 commit comments

Comments
 (0)