mirror of
https://github.com/ansible/awx.git
synced 2026-03-19 09:57:33 -02:30
allow reasonable scheduling of SCM inventory sources
This commit is contained in:
@@ -3396,6 +3396,10 @@ class ScheduleSerializer(BaseSerializer):
|
|||||||
raise serializers.ValidationError(_('Inventory Source must be a cloud resource.'))
|
raise serializers.ValidationError(_('Inventory Source must be a cloud resource.'))
|
||||||
elif type(value) == Project and value.scm_type == '':
|
elif type(value) == Project and value.scm_type == '':
|
||||||
raise serializers.ValidationError(_('Manual Project can not have a schedule set.'))
|
raise serializers.ValidationError(_('Manual Project can not have a schedule set.'))
|
||||||
|
elif type(value) == InventorySource and value.source == 'scm' and value.update_on_project_update:
|
||||||
|
raise serializers.ValidationError(_(
|
||||||
|
'Inventory sources with `update_on_project_update` can not be shceduled. '
|
||||||
|
'Schedule its source project `{}` instead.'.format(value.source_project.name)))
|
||||||
return value
|
return value
|
||||||
|
|
||||||
# We reject rrules if:
|
# We reject rrules if:
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
|
|
||||||
CLOUD_PROVIDERS = ('azure', 'azure_rm', 'ec2', 'gce', 'rax', 'vmware', 'openstack', 'satellite6', 'cloudforms')
|
CLOUD_PROVIDERS = ('azure', 'azure_rm', 'ec2', 'gce', 'rax', 'vmware', 'openstack', 'satellite6', 'cloudforms')
|
||||||
SCHEDULEABLE_PROVIDERS = CLOUD_PROVIDERS + ('custom',)
|
SCHEDULEABLE_PROVIDERS = CLOUD_PROVIDERS + ('custom', 'scm',)
|
||||||
|
|||||||
Reference in New Issue
Block a user