mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-19 07:11:25 +00:00
task get_path returns empty string when not in play
This commit is contained in:
@@ -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 '''
|
||||
|
||||
Reference in New Issue
Block a user