summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Core.py
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2015-07-24 23:38:04 +0200
committerSol Jerome <sol.jerome@gmail.com>2015-10-13 13:11:01 -0500
commit76ab7f6e8a2392a2dbe3d9cf4cf3c7399c6fa3f2 (patch)
tree497d4662b49285394dcc464bb3f7bcba615d602e /src/lib/Bcfg2/Server/Core.py
parent64dc09e18b8a34d57c9ff6c64cc9656c1e65c29c (diff)
downloadbcfg2-76ab7f6e8a2392a2dbe3d9cf4cf3c7399c6fa3f2.tar.gz
bcfg2-76ab7f6e8a2392a2dbe3d9cf4cf3c7399c6fa3f2.tar.bz2
bcfg2-76ab7f6e8a2392a2dbe3d9cf4cf3c7399c6fa3f2.zip
Admin: Add expirecache command
Expirecache is now part of bcfg2-admin and will call expire_metadata_cache from Core via XML-RPC. This will expire the metadata cache of the supplied clients (or the complete cache if no arguments are supplied) on a running bcfg2-server.
Diffstat (limited to 'src/lib/Bcfg2/Server/Core.py')
-rw-r--r--src/lib/Bcfg2/Server/Core.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py
index a9628c024..3db97f770 100644
--- a/src/lib/Bcfg2/Server/Core.py
+++ b/src/lib/Bcfg2/Server/Core.py
@@ -1368,6 +1368,21 @@ class Core(object):
return "This method is deprecated and will be removed in a future " + \
"release\n%s" % self.fam.set_debug(debug)
+ @exposed
+ def expire_metadata_cache(self, _, hostnames=None):
+ """ Expire the metadata cache for one or all clients
+
+ :param hostnames: A list of hostnames to expire the metadata
+ cache for or None. If None the cache of
+ all clients will be expired.
+ :type hostnames: None or list of strings
+ """
+ if hostnames is not None:
+ for hostname in hostnames:
+ self.metadata_cache.expire(hostname)
+ else:
+ self.metadata_cache.expire()
+
class NetworkCore(Core):
""" A server core that actually listens on the network, can be