use source_project custom_virtualenv if configured

Signed-off-by: Bram Verschueren <verschueren.bram@gmail.com>
This commit is contained in:
Bram Verschueren 2019-02-06 10:30:37 +01:00
parent e8eda28ce5
commit 016fc7f6bf
No known key found for this signature in database
GPG Key ID: DFB56AE5724E7B89

View File

@ -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: