Skip to content
Snippets Groups Projects
Commit 920b5878 authored by Guido Trotter's avatar Guido Trotter
Browse files

Convert ssconf._ReadFile to utils.ReadFile


Making ssconf._ReadFile a wrapper over utils.ReadFile

Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
parent 396b5733
No related branches found
No related tags found
No related merge requests found
...@@ -166,15 +166,11 @@ class SimpleStore(object): ...@@ -166,15 +166,11 @@ class SimpleStore(object):
""" """
filename = self.KeyToFilename(key) filename = self.KeyToFilename(key)
try: try:
fh = file(filename, 'r') data = utils.ReadFile(filename, size=self._MAX_SIZE)
try:
data = fh.read(self._MAX_SIZE)
data = data.rstrip('\n')
finally:
fh.close()
except EnvironmentError, err: except EnvironmentError, err:
raise errors.ConfigurationError("Can't read from the ssconf file:" raise errors.ConfigurationError("Can't read from the ssconf file:"
" '%s'" % str(err)) " '%s'" % str(err))
data = data.rstrip('\n')
return data return data
def WriteFiles(self, values): def WriteFiles(self, values):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment