From 34aafb2db9ee8bfc35ddfbb52fc5d535a59be881 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Tue, 20 Jan 2015 14:55:05 -0500 Subject: [PATCH] Fix an issue where we couldn't schedule custom inventory sources --- awx/api/serializers.py | 4 ++-- awx/main/constants.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 349185fff1..c6a2dbd2f5 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -35,7 +35,7 @@ from rest_framework import serializers from polymorphic import PolymorphicModel # AWX -from awx.main.constants import CLOUD_PROVIDERS +from awx.main.constants import SCHEDULEABLE_PROVIDERS from awx.main.models import * from awx.main.utils import update_scm_url, get_type_for_model, get_model_for_type @@ -1563,7 +1563,7 @@ class ScheduleSerializer(BaseSerializer): def validate_unified_job_template(self, attrs, source): ujt = attrs[source] - if type(ujt) == InventorySource and ujt.source not in CLOUD_PROVIDERS: + if type(ujt) == InventorySource and ujt.source not in SCHEDULEABLE_PROVIDERS: raise serializers.ValidationError('Inventory Source must be a cloud resource') return attrs diff --git a/awx/main/constants.py b/awx/main/constants.py index a278246d4d..6db7db00de 100644 --- a/awx/main/constants.py +++ b/awx/main/constants.py @@ -2,3 +2,4 @@ # All Rights Reserved. CLOUD_PROVIDERS = ('azure', 'ec2', 'gce', 'rax', 'vmware') +SCHEDULEABLE_PROVIDERS = CLOUD_PROVIDERS + ('custom',)