summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Bcfg2/Cache.py')
-rw-r--r--src/lib/Bcfg2/Cache.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/Bcfg2/Cache.py b/src/lib/Bcfg2/Cache.py
index 9a828e2c9..842098eda 100644
--- a/src/lib/Bcfg2/Cache.py
+++ b/src/lib/Bcfg2/Cache.py
@@ -2,11 +2,13 @@
doesn't provide many features, but more (time-based expiration, etc.)
can be added as necessary. """
+
class Cache(dict):
""" an implementation of a simple memory-backed cache """
+
def expire(self, key=None):
+ """ expire all items, or a specific item, from the cache """
if key is None:
self.clear()
elif key in self:
del self[key]
-