Add shorthand debugger method to recreate the task from the original ds (#46987)

* Add shorthand debugger method to recreate the task from the original ds, and re-template. Fixes #46321

* Fix rst header

* Indicate update_task was added in 2.8
This commit is contained in:
Matt Martz 2018-10-25 16:35:59 -05:00 committed by GitHub
commit f7ba63e047
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -1200,6 +1200,16 @@ class Debugger(cmd.Cmd):
do_r = do_redo
def do_update_task(self, args):
"""Recreate the task from ``task._ds``, and template with updated ``task_vars``"""
templar = Templar(None, shared_loader_obj=None, variables=self.scope['task_vars'])
task = self.scope['task']
task = task.load_data(task._ds)
task.post_validate(templar)
self.scope['task'] = task
do_u = do_update_task
def evaluate(self, args):
try:
return eval(args, globals(), self.scope)