mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Adjust job launch blocking logic
Previously a job template would always block another job template launch regardless of the details of the job template. We now restrict that blocking logic to only block in the case that the job template was launched with the same inventory. We keep the exclusion where if the launch type is 'callback' and the limits differ then they won't be blocked
This commit is contained in:
@@ -28,6 +28,7 @@ from awx.main.models.credential import Credential
|
||||
from awx.main.models.jobs import JobTemplate
|
||||
from awx.main.models.inventory import (
|
||||
Group,
|
||||
Inventory,
|
||||
)
|
||||
from awx.main.models.organization import (
|
||||
Organization,
|
||||
@@ -175,6 +176,16 @@ def machine_credential():
|
||||
def inventory(organization):
|
||||
return organization.inventories.create(name="test-inv")
|
||||
|
||||
@pytest.fixture
|
||||
def inventory_factory(organization):
|
||||
def factory(name, org=organization):
|
||||
try:
|
||||
inv = Inventory.objects.get(name=name, organization=org)
|
||||
except Inventory.DoesNotExist:
|
||||
inv = Inventory.objects.create(name=name, organization=org)
|
||||
return inv
|
||||
return factory
|
||||
|
||||
@pytest.fixture
|
||||
def label(organization):
|
||||
return organization.labels.create(name="test-label", description="test-label-desc")
|
||||
|
||||
Reference in New Issue
Block a user