NFVBENCH-215 Fix wrong throughput ratio in latency tests
[nfvbench.git] / nfvbench / nfvbench.py
index 0719247..740dca2 100644 (file)
@@ -736,7 +736,8 @@ def main():
         # dump the contents of the trex log file
         if opts.show_trex_log:
             try:
-                print(open('/tmp/trex.log').read(), end="")
+                with open('/tmp/trex.log') as trex_log_file:
+                    print(trex_log_file.read(), end="")
             except FileNotFoundError:
                 print("No TRex log file found!")
             sys.exit(0)