2017-03-18 01:07:39 +00:00
|
|
|
# This file is part of Ansible
|
|
|
|
#
|
|
|
|
# Ansible is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# Ansible is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
2017-09-08 18:08:31 +00:00
|
|
|
from __future__ import (absolute_import, division, print_function)
|
|
|
|
__metaclass__ = type
|
|
|
|
|
|
|
|
DOCUMENTATION = '''
|
2017-03-18 01:07:39 +00:00
|
|
|
strategy: debug
|
|
|
|
short_description: Executes tasks in interactive debug session.
|
|
|
|
description:
|
|
|
|
- Task execution is 'linear' but controlled by an interactive debug session.
|
|
|
|
version_added: "2.1"
|
|
|
|
author: Kishin Yagami
|
|
|
|
'''
|
2016-04-08 18:39:08 +00:00
|
|
|
|
|
|
|
import cmd
|
|
|
|
import pprint
|
|
|
|
import sys
|
|
|
|
|
2016-08-05 15:06:50 +00:00
|
|
|
from ansible.plugins.strategy.linear import StrategyModule as LinearStrategyModule
|
2016-04-08 18:39:08 +00:00
|
|
|
|
|
|
|
|
2016-08-05 15:06:50 +00:00
|
|
|
class StrategyModule(LinearStrategyModule):
|
2016-04-08 18:39:08 +00:00
|
|
|
def __init__(self, tqm):
|
2016-04-10 16:24:54 +00:00
|
|
|
super(StrategyModule, self).__init__(tqm)
|
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
2018-01-09 19:50:07 +00:00
|
|
|
self.debugger_active = True
|