From d1e5252e7b552f4938e87a00f8a4935d17735ac5 Mon Sep 17 00:00:00 2001 From: Fabiano Correa Mercer Date: Tue, 17 Dec 2024 17:06:31 -0300 Subject: [PATCH] Flush temp license file content The license_file may appear empty during the license plugin verification because the write() operation buffers the data in memory and does not immediately write it to disk. Calling flush() explicitly ensures that the content is written to disk immediately. Test Plan PASS: verify the license check passes with no empty file error Closes-bug: 2093343 Signed-off-by: Fabiano Correa Mercer Change-Id: Ibf5e04b1516ce789812e09a50689ec268cd06e4d --- software/scripts/deploy-precheck | 1 + 1 file changed, 1 insertion(+) diff --git a/software/scripts/deploy-precheck b/software/scripts/deploy-precheck index 54eeadde..7f90e3cc 100644 --- a/software/scripts/deploy-precheck +++ b/software/scripts/deploy-precheck @@ -78,6 +78,7 @@ class HealthCheck(object): with tempfile.NamedTemporaryFile(mode="w", delete=True) as license_file: try: license_file.write(license_dict["content"]) + license_file.flush() subprocess.check_call(["/usr/bin/verify-license", # pylint: disable=not-callable license_file.name, version],