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

Make sure role name doesn't end up in task name more than once

Fixes #11691
This commit is contained in:
James Cammarata 2015-07-22 07:28:25 -04:00
parent b09f1f8e0b
commit 975172c1ef

View file

@ -97,7 +97,7 @@ class Task(Base, Conditional, Taggable, Become):
def get_name(self):
''' return the name of the task '''
if self._role and self.name:
if self._role and self.name and not self.name.startswith("%s :" % self._role.get_name()):
return "%s : %s" % (self._role.get_name(), self.name)
elif self.name:
return self.name