mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
modify payload to cleanly close files
This commit is contained in:
parent
e640ac1057
commit
45755b7eac
@ -67,6 +67,7 @@ class Serial(object):
|
||||
Run the correct serialization to load a file
|
||||
'''
|
||||
data = fn_.read()
|
||||
fn_.close()
|
||||
return self.loads(data)
|
||||
|
||||
def dumps(self, msg):
|
||||
@ -83,3 +84,4 @@ class Serial(object):
|
||||
Serialize the correct data into the named file object
|
||||
'''
|
||||
fn_.write(self.dumps(msg))
|
||||
fn_.close()
|
||||
|
Loading…
Reference in New Issue
Block a user