From 016fc7f6bff25eda50fbc1c65113e0eca550e5e9 Mon Sep 17 00:00:00 2001 From: Bram Verschueren Date: Wed, 6 Feb 2019 10:30:37 +0100 Subject: [PATCH] use source_project custom_virtualenv if configured Signed-off-by: Bram Verschueren --- awx/main/models/inventory.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/awx/main/models/inventory.py b/awx/main/models/inventory.py index 6764ddb281..29e51e8110 100644 --- a/awx/main/models/inventory.py +++ b/awx/main/models/inventory.py @@ -1743,6 +1743,10 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions, JobNotificationMixin, @property def ansible_virtualenv_path(self): + if self.inventory_source and self.inventory_source.source_project: + project = self.inventory_source.source_project + if project and project.custom_virtualenv: + return project.custom_virtualenv if self.inventory_source and self.inventory_source.inventory: organization = self.inventory_source.inventory.organization if organization and organization.custom_virtualenv: