on host callback, upate dynamic inv only once

* During a job template launch via the host callback launch feature,
when the host launching the job template is not found; we try to launch
associated dyn inv updates to pick up the host. Then the inv is searched
again for the host. If the host is found, then the jt is launched. This
fix carries forward the feature that prevents the dyn inv update with
cache timeout of 0 from being re-launched with the new task manager.
This commit is contained in:
Chris Meyers
2016-11-02 15:45:57 -05:00
parent 549274f97b
commit adcf0af2a0
3 changed files with 36 additions and 10 deletions

View File

@@ -230,7 +230,12 @@ class TaskManager():
dependencies.append(project_task)
# Inventory created 2 seconds behind job
inventory_sources_already_updated = task.get_inventory_sources_already_updated()
for inventory_source_task in self.graph.get_inventory_sources(task['inventory_id']):
if inventory_source_task['id'] in inventory_sources_already_updated:
print("Inventory already updated")
continue
if self.graph.should_update_related_inventory_source(task, inventory_source_task['id']):
inventory_task = self.create_inventory_update(task, inventory_source_task)
dependencies.append(inventory_task)