diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 98090bb611..a95a7f0c41 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -2763,8 +2763,8 @@ class AdHocCommandSerializer(UnifiedJobSerializer): redacted_extra_vars, removed_vars = extract_ansible_vars(value) if removed_vars: raise serializers.ValidationError(_( - "Variables {} are prohibited from use in ad hoc commands." - ).format(",".join(removed_vars))) + "{} are prohibited from use in ad hoc commands." + ).format(", ".join(removed_vars))) return vars_validate_or_raise(value) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 3bc4bc9c45..66ba251f40 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -2142,8 +2142,8 @@ class RunAdHocCommand(BaseTask): redacted_extra_vars, removed_vars = extract_ansible_vars(ad_hoc_command.extra_vars_dict) if removed_vars: raise ValueError(_( - "unable to use {} variables with ad hoc commands" - ).format(",".format(removed_vars))) + "{} are prohibited from use in ad hoc commands." + ).format(", ".join(removed_vars))) args.extend(['-e', json.dumps(ad_hoc_command.extra_vars_dict)])