Skip to content

Instantly share code, notes, and snippets.

@dmsimard
Created May 12, 2016 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmsimard/0bb66df6475e5d2563c23cb34de9dd4a to your computer and use it in GitHub Desktop.
Save dmsimard/0bb66df6475e5d2563c23cb34de9dd4a to your computer and use it in GitHub Desktop.
def take_action(self, parsed_args):
tasks = (models.Task.query
.join(models.Play)
.join(models.Playbook)
.filter(models.Task.playbook_id == models.Playbook.id)
.filter(models.Task.play_id == models.Play.id))
return (('ID', 'Name', 'Path', 'Playbook', 'Play', 'Action', 'Line', 'Handler', 'Time Start', 'Time End'),
[(task.id,
task.name,
task.path,
task.playbook.path,
task.play.name,
task.action,
task.lineno,
task.is_handler,
task.time_start,
task.time_end
)
for task in tasks])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment