From 0ac9997e9781f6b5beb47107431d960077234139 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 16 Nov 2012 09:46:36 -0500 Subject: documented new core debug RMIs --- src/lib/Bcfg2/Server/Core.py | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py index c23d3cf24..ee875a7e8 100644 --- a/src/lib/Bcfg2/Server/Core.py +++ b/src/lib/Bcfg2/Server/Core.py @@ -1067,25 +1067,59 @@ class BaseCore(object): @exposed def get_statistics(self, _): """ Get current statistics about component execution from - :attr:`Bcfg2.Statistics.stats`. """ + :attr:`Bcfg2.Statistics.stats`. + + :returns: dict - The statistics data as returned by + :func:`Bcfg2.Statistics.Statistics.display` """ return Bcfg2.Statistics.stats.display() @exposed def toggle_debug(self, address): + """ Toggle debug status of the FAM and all plugins + + :param address: Client (address, hostname) pair + :type address: tuple + :returns: bool - The new debug state of the FAM + """ for plugin in self.plugins.values(): plugin.toggle_debug() return self.toggle_fam_debug(address) @exposed def toggle_fam_debug(self, _): + """ Toggle debug status of the FAM + + :returns: bool - The new debug state of the FAM + """ return self.fam.toggle_debug() @exposed def set_debug(self, address, debug): + """ Explicitly set debug status of the FAM and all plugins + + :param debug: The new debug status. This can either be a + boolean, or a string describing the state (e.g., + "true" or "false"; case-insensitive) + :type debug: bool or string + :returns: bool - The new debug state + """ + if debug not in [True, False]: + debug = debug.lower() == "true" for plugin in self.plugins.values(): plugin.set_debug(debug) return self.set_fam_debug(address, debug) @exposed def set_fam_debug(self, _, debug): + """ Explicitly set debug status of the FAM + + :param debug: The new debug status of the FAM. This can + either be a boolean, or a string describing the + state (e.g., "true" or "false"; + case-insensitive) + :type debug: bool or string + :returns: bool - The new debug state of the FAM + """ + if debug not in [True, False]: + debug = debug.lower() == "true" return self.fam.set_debug(debug) -- cgit v1.2.3-1-g7c22