Implement fact cache flushing alongside a command-line argument to invoke it.

This commit is contained in:
Josh Drake
2014-07-03 14:02:26 -05:00
committed by Michael DeHaan
parent aa419044c4
commit 917e868f65
7 changed files with 32 additions and 7 deletions

View File

@@ -50,10 +50,12 @@ class FactCache(MutableMapping):
return len(self._plugin.keys())
def copy(self):
"""
Return a primitive copy of the keys and values from the cache.
"""
""" Return a primitive copy of the keys and values from the cache. """
return dict([(k, v) for (k, v) in self.iteritems()])
def keys(self):
return self._plugin.keys()
def flush(self):
""" Flush the fact cache of all keys. """
self._plugin.flush()