mirror of
https://github.com/ansible/awx.git
synced 2026-03-16 00:17:29 -02:30
Make schedules accept gce/vmware/wa credentials.
This commit is contained in:
@@ -34,6 +34,7 @@ from rest_framework import serializers
|
|||||||
from polymorphic import PolymorphicModel
|
from polymorphic import PolymorphicModel
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
|
from awx.main.constants import CLOUD_PROVIDERS
|
||||||
from awx.main.models import *
|
from awx.main.models import *
|
||||||
from awx.main.utils import update_scm_url, get_type_for_model, get_model_for_type
|
from awx.main.utils import update_scm_url, get_type_for_model, get_model_for_type
|
||||||
|
|
||||||
@@ -1389,7 +1390,7 @@ class ScheduleSerializer(BaseSerializer):
|
|||||||
|
|
||||||
def validate_unified_job_template(self, attrs, source):
|
def validate_unified_job_template(self, attrs, source):
|
||||||
ujt = attrs[source]
|
ujt = attrs[source]
|
||||||
if type(ujt) == InventorySource and ujt.source not in ('rax', 'ec2',):
|
if type(ujt) == InventorySource and ujt.source not in CLOUD_PROVIDERS:
|
||||||
raise serializers.ValidationError('Inventory Source must be a cloud resource')
|
raise serializers.ValidationError('Inventory Source must be a cloud resource')
|
||||||
return attrs
|
return attrs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user