Merge "Fixed open tempfile.NamedTemporaryFile as text in Python3"

This commit is contained in:
Zuul 2019-12-17 11:47:12 +00:00 committed by Gerrit Code Review
commit 8a534aaefe
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ class NVMET(nvmeof.NVMeOF):
def _restore(self, nvmf_subsystems):
# Dump updated JSON dict to append new subsystem
with tempfile.NamedTemporaryFile() as tmp_fd:
with tempfile.NamedTemporaryFile(mode='w') as tmp_fd:
tmp_fd.write(json.dumps(nvmf_subsystems))
tmp_fd.flush()
try: