Fix heat template validation when multi users
Fix that after the first user-related f.read(), the next user will attempt to f.read() at the end of the file, correcting the sending of blank content. Closes-bug: #2054790 Change-Id: I95d73d3459087c8c18c1ecd5e7d1833268e7ed75
This commit is contained in:
parent
275e639388
commit
2c05430515
@ -53,6 +53,8 @@ Fixed
|
||||
|
||||
* Nova server cleanup fails to list resources due to wrong marker.
|
||||
|
||||
* Heat template validation when multi users.
|
||||
|
||||
[2.3.0] - 2023-08-01
|
||||
--------------------
|
||||
|
||||
|
@ -469,9 +469,10 @@ class ValidateHeatTemplateValidator(validation.Validator):
|
||||
self.fail("No file found by the given path %s" % template_path)
|
||||
with open(template_path, "r") as f:
|
||||
try:
|
||||
template_file = f.read()
|
||||
for user in context["users"]:
|
||||
clients = user["credential"].clients()
|
||||
clients.heat().stacks.validate(template=f.read())
|
||||
clients.heat().stacks.validate(template=template_file)
|
||||
except Exception as e:
|
||||
self.fail("Heat template validation failed on %(path)s. "
|
||||
"Original error message: %(msg)s." %
|
||||
|
Loading…
Reference in New Issue
Block a user