Merge "Move all opens in auth_token to be in context"

This commit is contained in:
Jenkins
2013-08-23 09:34:34 +00:00
committed by Gerrit Code Review

View File

@@ -1231,9 +1231,8 @@ class AuthProtocol(object):
response, data = self._http_request('GET', path)
def write_cert_file(data):
certfile = open(self.signing_cert_file_name, 'w')
certfile.write(data)
certfile.close()
with open(self.signing_cert_file_name, 'w') as certfile:
certfile.write(data)
try:
#todo check response
@@ -1253,9 +1252,8 @@ class AuthProtocol(object):
try:
#todo check response
certfile = open(self.ca_file_name, 'w')
certfile.write(data)
certfile.close()
with open(self.ca_file_name, 'w') as certfile:
certfile.write(data)
except (AssertionError, KeyError):
self.LOG.warn(
"Unexpected response from keystone service: %s", data)