mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 11:25:08 -02:30
Remove insights_credential from inventory
This commit is contained in:
committed by
Shane McDonald
parent
0947d30682
commit
1e68519c99
@@ -59,14 +59,12 @@ class Inventory(HasCopy, HasCreate, HasInstanceGroups, HasVariables, base.Base):
|
||||
organization=organization.id,
|
||||
)
|
||||
|
||||
optional_fields = ('host_filter', 'insights_credential', 'kind', 'variables')
|
||||
optional_fields = ('host_filter', 'kind', 'variables')
|
||||
|
||||
update_payload(payload, optional_fields, kwargs)
|
||||
|
||||
if 'variables' in payload and isinstance(payload.variables, dict):
|
||||
payload.variables = json.dumps(payload.variables)
|
||||
if 'insights_credential' in payload and isinstance(payload.insights_credential, Credential):
|
||||
payload.insights_credential = payload.insights_credential.id
|
||||
|
||||
return payload
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ def pk_or_name(v2, model_name, value, page=None):
|
||||
identity = UNIQUENESS_RULES[model_name][-1]
|
||||
|
||||
# certain related fields follow a pattern of <foo>_<model> e.g.,
|
||||
# insights_credential, target_credential etc...
|
||||
# target_credential etc...
|
||||
if not page and '_' in model_name:
|
||||
return pk_or_name(v2, model_name.split('_')[-1], value, page)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user