1
0
Fork 0

utils: added return code to write_to_file

This commit is contained in:
Jaroslav Škarvada 2012-11-30 12:09:25 +01:00
parent 3d57c489cc
commit c58b798412

View file

@ -16,8 +16,11 @@ def write_to_file(f, data):
fd = open(f, "w")
fd.write(str(data))
fd.close()
rc = True
except (OSError,IOError) as e:
rc = False
log.error("Writing to file %s error: %s" % (f, e))
return rc
def read_file(f):
old_value = ""