Merge pull request #2882 from AlanCoding/just_credential2

[option2] move inventory source vault credential validation from view to model
This commit is contained in:
Alan Rominger
2018-08-21 13:24:50 -04:00
committed by GitHub
5 changed files with 124 additions and 10 deletions

View File

@@ -1262,6 +1262,11 @@ class InventorySourceOptions(BaseModel):
'Credentials of type machine, source control, insights and vault are '
'disallowed for custom inventory sources.'
)
elif source == 'scm' and cred and cred.credential_type.kind in ('insights', 'vault'):
return _(
'Credentials of type insights and vault are '
'disallowed for scm inventory sources.'
)
return None
def get_inventory_plugin_name(self):