mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
task get_path returns empty string when not in play
This commit is contained in:
parent
52d4079184
commit
7c690f04e2
1 changed files with 4 additions and 2 deletions
|
@ -99,8 +99,10 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
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)
|
||||
path = ""
|
||||
if hasattr(self, '_ds') and hasattr(self._ds, '_data_source') and hasattr(self._ds, '_line_number'):
|
||||
path = "%s:%s" % (self._ds._data_source, self._ds._line_number)
|
||||
return path
|
||||
|
||||
def get_name(self):
|
||||
''' return the name of the task '''
|
||||
|
|
Loading…
Reference in a new issue