Merge pull request #6912 from AlanCoding/schedule_scm_inv

Allow scheduling of SCM inventory sources (with exception)
This commit is contained in:
Alan Rominger 2017-07-10 21:55:16 -04:00 committed by GitHub
commit b8b2d8695e
2 changed files with 5 additions and 1 deletions

View File

@ -3404,6 +3404,10 @@ class ScheduleSerializer(BaseSerializer):
raise serializers.ValidationError(_('Inventory Source must be a cloud resource.'))
elif type(value) == Project and value.scm_type == '':
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
# We reject rrules if:

View File

@ -2,4 +2,4 @@
# All Rights Reserved.
CLOUD_PROVIDERS = ('azure', 'azure_rm', 'ec2', 'gce', 'rax', 'vmware', 'openstack', 'satellite6', 'cloudforms')
SCHEDULEABLE_PROVIDERS = CLOUD_PROVIDERS + ('custom',)
SCHEDULEABLE_PROVIDERS = CLOUD_PROVIDERS + ('custom', 'scm',)