Fix validations_inputs temporary file name

All the validations were failing when running through Mistral with a
`sudo` command not allowed issue [1] due to a typo in the file name.

This patch fixes the name of the temporary files containing potential
ansible variables.

[1] mistral : command not allowed ; TTY=unknown ; PWD=/ ; USER=root
 ; COMMAND=/usr/bin/chown -h validations: /tmp/validation_inputs_PoJRZa

Change-Id: I6699bbbab5cb15a8fd200c144a3d575e9f29ca37
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
(cherry picked from commit f3a93bffb8)
This commit is contained in:
Gael Chamoulaud 2019-05-15 12:14:21 +02:00
parent a9e05d4750
commit af719c4c92

View File

@ -183,7 +183,7 @@ def pattern_validator(pattern, value):
def write_inputs_file(inputs):
"""Serialise the validation inputs to a file on disk."""
fd, path = tempfile.mkstemp(prefix='validation_inputs_')
fd, path = tempfile.mkstemp(prefix='validations_inputs_')
LOG.debug("Writing the validation inputs to %s", path)
with os.fdopen(fd, 'w') as tmp:
tmp.write(yaml.dump(inputs))