utils: added return code to write_to_file
This commit is contained in:
parent
3d57c489cc
commit
c58b798412
1 changed files with 3 additions and 0 deletions
|
|
@ -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 = ""
|
||||
|
|
|
|||
Loading…
Reference in a new issue