Optimize "open" method with context manager

Replace the classic open() method with opening context
manager to open file so that the file will be closed
even if an exception occurs.

Change-Id: I0d53b7a38fee6a2ef8ce74496d220adc954afb98
diff --git a/neutron/tests/tempest/common/accounts.py b/neutron/tests/tempest/common/accounts.py
index 1a50e3c..6440739 100644
--- a/neutron/tests/tempest/common/accounts.py
+++ b/neutron/tests/tempest/common/accounts.py
@@ -28,8 +28,8 @@
 
 
 def read_accounts_yaml(path):
-    yaml_file = open(path, 'r')
-    accounts = yaml.load(yaml_file)
+    with open(path, 'r') as yaml_file:
+        accounts = yaml.load(yaml_file)
     return accounts