Improve the behavior of EE resolution for ad hoc commands

- call resolve_execution_environment during AdHocCommand.save()
- wrap the fallback call of the resolver in tasks.py in disable_activity_stream()
This commit is contained in:
Jeff Bradberry
2020-12-11 10:09:27 -05:00
committed by Shane McDonald
parent 12b8349e88
commit 9964ba7c9a
2 changed files with 8 additions and 2 deletions

View File

@@ -888,8 +888,11 @@ class BaseTask(object):
def build_execution_environment_params(self, instance):
if instance.execution_environment_id is None:
self.instance = instance = self.update_model(
instance.pk, execution_environment=instance.resolve_execution_environment())
from awx.main.signals import disable_activity_stream
with disable_activity_stream():
self.instance = instance = self.update_model(
instance.pk, execution_environment=instance.resolve_execution_environment())
image = instance.execution_environment.image
params = {