setup caching 1st draft
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
setup cache 1st draft, commit 2
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
now actually loads the filters, but breaks at trying to run cache ..
fixing
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
now still always returns dict even if someone set value to None for a
key
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
fixed None and clear() corner cases
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
switched to using dictmixin for cache object, mulling about
collections.mutablemappings as alternative
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
ensure name is stirng

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
cleaned up remanents from prev iteratoin
fixed issue with setter
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
now value is correct for in memory cache, if it comes from cache plugin,
new facts or default (dict).

corrected setdefault param mismatch

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
now only returns values if it expired
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
moved default factory to None and now pass dict (closer to defaultdict
behaviour)

added __contains__ method in cache

currently merges local cache with facts, for some reason 'in' doesn't
seem to match existing keys.

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
added new functions and error checking

- now checks if cachd_dir is actualy a dir
- cached function returns list of cached keys/hosts
- now stats file to se if it has 'expired'

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
fixed bug in contains, added keys and validate_key methods
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
reverted to inherit for dict and use dict methods directly
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
now forces save when destroyed
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
Work in progress on fact caching implementation.
Tests that rely on event count returns do not actually test correctly, and should be expunged.
Fixes #5513. set is built-in since 2.4 and deprecated since 2.6
Merge pull request #5517 from lichesser/fix_set_depreciation_warning

Fixes #5513. set is built-in since 2.4 and deprecated since 2.6
While looking into filters, I noticed that the documentation has a typo. symetric should be symmetric. I fixed the typo and verified that the filter in core.py is spelled correctly.