mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Remove usage of AWXReceptorJob in metadata.py
This commit is contained in:
committed by
Jeff Bradberry
parent
673afdf1b5
commit
373cd9c20b
@@ -24,7 +24,7 @@ from rest_framework.request import clone_request
|
|||||||
from awx.api.fields import ChoiceNullField
|
from awx.api.fields import ChoiceNullField
|
||||||
from awx.main.fields import JSONField, ImplicitRoleField
|
from awx.main.fields import JSONField, ImplicitRoleField
|
||||||
from awx.main.models import NotificationTemplate
|
from awx.main.models import NotificationTemplate
|
||||||
from awx.main.tasks import AWXReceptorJob
|
from awx.main.utils.execution_environments import get_default_pod_spec
|
||||||
|
|
||||||
# Polymorphic
|
# Polymorphic
|
||||||
from polymorphic.models import PolymorphicModel
|
from polymorphic.models import PolymorphicModel
|
||||||
@@ -211,7 +211,7 @@ class Metadata(metadata.SimpleMetadata):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if field == "pod_spec_override":
|
if field == "pod_spec_override":
|
||||||
meta['default'] = AWXReceptorJob().pod_definition
|
meta['default'] = get_default_pod_spec()
|
||||||
|
|
||||||
# Add type choices if available from the serializer.
|
# Add type choices if available from the serializer.
|
||||||
if field == 'type' and hasattr(serializer, 'get_type_choices'):
|
if field == 'type' and hasattr(serializer, 'get_type_choices'):
|
||||||
|
|||||||
@@ -2879,7 +2879,7 @@ class TransmitterThread(threading.Thread):
|
|||||||
|
|
||||||
|
|
||||||
class AWXReceptorJob:
|
class AWXReceptorJob:
|
||||||
def __init__(self, task=None, runner_params=None):
|
def __init__(self, task, runner_params=None):
|
||||||
self.task = task
|
self.task = task
|
||||||
self.runner_params = runner_params
|
self.runner_params = runner_params
|
||||||
self.unit_id = None
|
self.unit_id = None
|
||||||
@@ -3034,10 +3034,7 @@ class AWXReceptorJob:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def pod_definition(self):
|
def pod_definition(self):
|
||||||
if self.task and self.task.instance.execution_environment:
|
ee = self.task.instance.execution_environment
|
||||||
ee = self.task.instance.execution_environment
|
|
||||||
else:
|
|
||||||
ee = get_default_execution_environment()
|
|
||||||
|
|
||||||
default_pod_spec = get_default_pod_spec()
|
default_pod_spec = get_default_pod_spec()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user