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 <fabiano.correamercer@windriver.com> Change-Id: Ibf5e04b1516ce789812e09a50689ec268cd06e4d
This commit is contained in:
parent
996dff0313
commit
d1e5252e7b
@ -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],
|
||||
|
Loading…
x
Reference in New Issue
Block a user