mirror of
https://github.com/ansible/awx.git
synced 2026-05-18 06:47:41 -02:30
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:
committed by
Shane McDonald
parent
12b8349e88
commit
9964ba7c9a
@@ -209,6 +209,9 @@ class AdHocCommand(UnifiedJob, JobNotificationMixin):
|
|||||||
self.name = Truncator(u': '.join(filter(None, (self.module_name, self.module_args)))).chars(512)
|
self.name = Truncator(u': '.join(filter(None, (self.module_name, self.module_args)))).chars(512)
|
||||||
if 'name' not in update_fields:
|
if 'name' not in update_fields:
|
||||||
update_fields.append('name')
|
update_fields.append('name')
|
||||||
|
if not self.execution_environment_id:
|
||||||
|
self.execution_environment = self.resolve_execution_environment()
|
||||||
|
update_fields.append('execution_environment')
|
||||||
super(AdHocCommand, self).save(*args, **kwargs)
|
super(AdHocCommand, self).save(*args, **kwargs)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -888,8 +888,11 @@ class BaseTask(object):
|
|||||||
|
|
||||||
def build_execution_environment_params(self, instance):
|
def build_execution_environment_params(self, instance):
|
||||||
if instance.execution_environment_id is None:
|
if instance.execution_environment_id is None:
|
||||||
self.instance = instance = self.update_model(
|
from awx.main.signals import disable_activity_stream
|
||||||
instance.pk, execution_environment=instance.resolve_execution_environment())
|
|
||||||
|
with disable_activity_stream():
|
||||||
|
self.instance = instance = self.update_model(
|
||||||
|
instance.pk, execution_environment=instance.resolve_execution_environment())
|
||||||
|
|
||||||
image = instance.execution_environment.image
|
image = instance.execution_environment.image
|
||||||
params = {
|
params = {
|
||||||
|
|||||||
Reference in New Issue
Block a user