run scm inv syncs at the project root so relative imports work w/ bwrap

see: https://github.com/ansible/tower/issues/1357
This commit is contained in:
Ryan Petrello
2018-05-15 12:00:37 -04:00
parent fd0b439ee6
commit 3ab7f06f95
2 changed files with 7 additions and 2 deletions

View File

@@ -1720,6 +1720,10 @@ class RunInventoryUpdate(BaseTask):
event_model = InventoryUpdateEvent
event_data_key = 'inventory_update_id'
@property
def proot_show_paths(self):
return [self.get_path_to('..', 'plugins', 'inventory')]
def build_private_data(self, inventory_update, **kwargs):
"""
Return private data needed for inventory update.
@@ -2075,6 +2079,8 @@ class RunInventoryUpdate(BaseTask):
return args
def build_cwd(self, inventory_update, **kwargs):
if inventory_update.source == 'scm' and inventory_update.source_project_update:
return inventory_update.source_project_update.get_project_path(check_if_exists=False)
return self.get_path_to('..', 'plugins', 'inventory')
def get_idle_timeout(self):