diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-11-16 09:46:36 -0500 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-11-16 09:57:54 -0500 |
commit | 0ac9997e9781f6b5beb47107431d960077234139 (patch) | |
tree | a43d0acaae3917b44859581f3f9a948c27af165d /src | |
parent | 1d953e4512c8d4cc9ce536da3522a59d812d58b9 (diff) | |
download | bcfg2-0ac9997e9781f6b5beb47107431d960077234139.tar.gz bcfg2-0ac9997e9781f6b5beb47107431d960077234139.tar.bz2 bcfg2-0ac9997e9781f6b5beb47107431d960077234139.zip |
documented new core debug RMIs
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Bcfg2/Server/Core.py | 36 |
1 files changed, 35 insertions, 1 deletions
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) |