From 2c05430515be6d253abbc3d5a8af7d28a5827409 Mon Sep 17 00:00:00 2001 From: do-gyun Date: Fri, 23 Feb 2024 17:59:57 +0900 Subject: [PATCH] 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 --- CHANGELOG.rst | 2 ++ rally_openstack/common/validators.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a80214f5..a903105c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 -------------------- diff --git a/rally_openstack/common/validators.py b/rally_openstack/common/validators.py index 77dcda39..ed1f21c2 100644 --- a/rally_openstack/common/validators.py +++ b/rally_openstack/common/validators.py @@ -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." %