From 9bc0bf0ee728d95a715f2a6db9ccd5c68961010e Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Mon, 29 Mar 2021 13:09:56 -0400 Subject: [PATCH] Fix inventory updates when running inside of k8s --- awx/main/models/inventory.py | 4 ++++ awx/main/tasks.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/awx/main/models/inventory.py b/awx/main/models/inventory.py index cbec2963ca..6fabdf7567 100644 --- a/awx/main/models/inventory.py +++ b/awx/main/models/inventory.py @@ -1227,6 +1227,10 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions, JobNotificationMixin, null=True, ) + @property + def is_container_group_task(self): + return bool(self.instance_group and self.instance_group.is_container_group) + def _get_parent_field_name(self): return 'inventory_source' diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 43a629b288..e05045574f 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -2505,7 +2505,7 @@ class RunInventoryUpdate(BaseTask): args.append(container_location) args.append('--output') - args.append(os.path.join('/runner', 'artifacts', 'output.json')) + args.append(os.path.join('/runner', 'artifacts', str(inventory_update.id), 'output.json')) if os.path.isdir(source_location): playbook_dir = container_location