mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 22:11:44 -07:00
Provide a way to explicitly invoke the debugger (#34006)
* Provide a way to explicitly invoke the debugger with in the debug strategy * Merge the debugger strategy into StrategyBase * Fix some logic, pin to a single result * Make redo also continue * Make sure that if the debug closure doesn't need to process the result, that we still return it * Fix failing tests for the strategy * Clean up messages from debugger and exit code to match bin/ansible * Move the FieldAttribute higher, to apply at different levels * make debugger a string, expand logic * Better host state rollbacks * More explicit debugger prompt * ENABLE_TASK_DEBUGGER should be boolean, and better docs * No bare except, add pprint, alias h, vars to task_vars * _validate_debugger can ignore non-string, that can be caught later * Address issue if there were no previous tasks/state, and use the correct key * Update docs for changes to the debugger * Guard against a stat going negative through use of decrement * Add a few notes about using the debugger on the free strategy * Add changelog entry for task debugger * Add a few versionadded indicators and a note about vars -> task_vars
This commit is contained in:
parent
e802b769e6
commit
d1846425db
9 changed files with 394 additions and 176 deletions
|
@ -46,6 +46,16 @@ class AggregateStats:
|
|||
prev = (getattr(self, what)).get(host, 0)
|
||||
getattr(self, what)[host] = prev + 1
|
||||
|
||||
def decrement(self, what, host):
|
||||
_what = getattr(self, what)
|
||||
try:
|
||||
if _what[host] - 1 < 0:
|
||||
# This should never happen, but let's be safe
|
||||
raise KeyError("Don't be so negative")
|
||||
_what[host] -= 1
|
||||
except KeyError:
|
||||
_what[host] = 0
|
||||
|
||||
def summarize(self, host):
|
||||
''' return information about a particular host '''
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue