mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Standardize exception handling
This commit is contained in:
parent
a620ef414e
commit
bdee1ff24e
1 changed files with 9 additions and 6 deletions
15
lib/ansible/cache/base.py
vendored
15
lib/ansible/cache/base.py
vendored
|
@ -1,18 +1,21 @@
|
|||
import exceptions
|
||||
|
||||
class BaseCacheModule(object):
|
||||
|
||||
def get(self, key):
|
||||
raise NotImplementedError("Subclasses of {} must implement the '{}' method".format(self.__class__.__name__, self.__name__))
|
||||
raise exceptions.NotImplementedError
|
||||
|
||||
def set(self, key, value):
|
||||
raise NotImplementedError("Subclasses of {} must implement the '{}' method".format(self.__class__.__name__, self.__name__))
|
||||
raise exceptions.NotImplementedError
|
||||
|
||||
def keys(self):
|
||||
raise NotImplementedError("Subclasses of {} must implement the '{}' method".format(self.__class__.__name__, self.__name__))
|
||||
raise exceptions.NotImplementedError
|
||||
|
||||
def contains(self, key):
|
||||
raise NotImplementedError("Subclasses of {} must implement the '{}' method".format(self.__class__.__name__, self.__name__))
|
||||
raise exceptions.NotImplementedError
|
||||
|
||||
def delete(self, key):
|
||||
raise NotImplementedError("Subclasses of {} must implement the '{}' method".format(self.__class__.__name__, self.__name__))
|
||||
raise exceptions.NotImplementedError
|
||||
|
||||
def flush(self):
|
||||
raise NotImplementedError("Subclasses of {} must implement the '{}' method".format(self.__class__.__name__, self.__name__))
|
||||
raise exceptions.NotImplementedError
|
||||
|
|
Loading…
Reference in a new issue