mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 09:51:09 +03:00
feedback on ad hoc prohibited vars error msg
This commit is contained in:
parent
721674f0cd
commit
edda5e5420
@ -2763,8 +2763,8 @@ class AdHocCommandSerializer(UnifiedJobSerializer):
|
|||||||
redacted_extra_vars, removed_vars = extract_ansible_vars(value)
|
redacted_extra_vars, removed_vars = extract_ansible_vars(value)
|
||||||
if removed_vars:
|
if removed_vars:
|
||||||
raise serializers.ValidationError(_(
|
raise serializers.ValidationError(_(
|
||||||
"Variables {} are prohibited from use in ad hoc commands."
|
"{} are prohibited from use in ad hoc commands."
|
||||||
).format(",".join(removed_vars)))
|
).format(", ".join(removed_vars)))
|
||||||
return vars_validate_or_raise(value)
|
return vars_validate_or_raise(value)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2142,8 +2142,8 @@ class RunAdHocCommand(BaseTask):
|
|||||||
redacted_extra_vars, removed_vars = extract_ansible_vars(ad_hoc_command.extra_vars_dict)
|
redacted_extra_vars, removed_vars = extract_ansible_vars(ad_hoc_command.extra_vars_dict)
|
||||||
if removed_vars:
|
if removed_vars:
|
||||||
raise ValueError(_(
|
raise ValueError(_(
|
||||||
"unable to use {} variables with ad hoc commands"
|
"{} are prohibited from use in ad hoc commands."
|
||||||
).format(",".format(removed_vars)))
|
).format(", ".join(removed_vars)))
|
||||||
|
|
||||||
args.extend(['-e', json.dumps(ad_hoc_command.extra_vars_dict)])
|
args.extend(['-e', json.dumps(ad_hoc_command.extra_vars_dict)])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user