1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

get path from play if task does not have

fixes #28451
This commit is contained in:
Brian Coca 2017-11-07 19:38:01 -05:00 committed by Brian Coca
parent 306c3508b2
commit 437babbd07

View file

@ -106,6 +106,8 @@ class Task(Base, Conditional, Taggable, Become):
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)
elif hasattr(self._parent._play, '_ds') and hasattr(self._parent._play._ds, '_data_source') and hasattr(self._parent._play._ds, '_line_number'):
path = "%s:%s" % (self._parent._play._ds._data_source, self._parent._play._ds._line_number)
return path
def get_name(self):