Don't iterate through the play vars if we don't need to

Change-Id: I609f511ff268d2d23f39f2262728bb6dcf684341
This commit is contained in:
David Moreau Simard 2019-04-16 20:56:59 -04:00
parent 4aa812bd11
commit d56c68f749
No known key found for this signature in database
GPG Key ID: CBEB466764A9E621

View File

@ -161,9 +161,8 @@ class CallbackModule(CallbackBase):
# Load variables to verify if there is anything relevant for ara
play_vars = play._variable_manager.get_vars(play=play)["vars"]
for key in play_vars.keys():
if key == "ara_playbook_name":
self._set_playbook_name(name=play_vars[key])
if "ara_playbook_name" in play_vars:
self._set_playbook_name(name=play_vars["ara_playbook_name"])
# Record all the files involved in the play
for path in play._loader._FILE_CACHE.keys():