mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Adding get_path method to Task class
This commit is contained in:
parent
9e364c2eb5
commit
254d6be520
1 changed files with 6 additions and 0 deletions
|
@ -101,6 +101,12 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
|
||||
super(Task, self).__init__()
|
||||
|
||||
def get_path(self):
|
||||
''' return the absolute path of the task with its line number '''
|
||||
|
||||
if hasattr(self, '_ds'):
|
||||
return "%s:%s" % (self._ds._data_source, self._ds._line_number)
|
||||
|
||||
def get_name(self):
|
||||
''' return the name of the task '''
|
||||
|
||||
|
|
Loading…
Reference in a new issue