mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 11:25:08 -02:30
Respond to PR feedback
This commit is contained in:
@@ -696,7 +696,7 @@ class CredentialTypeInjectorField(JSONSchemaField):
|
|||||||
'file': {
|
'file': {
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
'patternProperties': {
|
'patternProperties': {
|
||||||
'^template(\.[a-zA-Z_]+)?$': {'type': 'string'},
|
'^template(\.[a-zA-Z_]+[a-zA-Z0-9_]*)?$': {'type': 'string'},
|
||||||
},
|
},
|
||||||
'additionalProperties': False,
|
'additionalProperties': False,
|
||||||
},
|
},
|
||||||
@@ -751,9 +751,7 @@ class CredentialTypeInjectorField(JSONSchemaField):
|
|||||||
valid_namespace['tower'] = TowerNamespace()
|
valid_namespace['tower'] = TowerNamespace()
|
||||||
|
|
||||||
# ensure either single file or multi-file syntax is used (but not both)
|
# ensure either single file or multi-file syntax is used (but not both)
|
||||||
template_names = set(key for type_, injector in value.items()
|
template_names = [x for x in value.get('file', {}).keys() if x.startswith('template')]
|
||||||
for key, tmpl in injector.items()
|
|
||||||
if key.startswith('template'))
|
|
||||||
if 'template' in template_names and len(template_names) > 1:
|
if 'template' in template_names and len(template_names) > 1:
|
||||||
raise django_exceptions.ValidationError(
|
raise django_exceptions.ValidationError(
|
||||||
_('Must use multi-file syntax when injecting multiple files'),
|
_('Must use multi-file syntax when injecting multiple files'),
|
||||||
|
|||||||
Reference in New Issue
Block a user