Write new file to a temporary and move it afterwards.
parent
53d8f4bcf2
commit
33d7b3aefc
|
@ -67,6 +67,10 @@ rrd.update_images()
|
||||||
|
|
||||||
m = D3MapBuilder(db)
|
m = D3MapBuilder(db)
|
||||||
|
|
||||||
nodes_json = open(options['destination_directory'] + '/nodes.json','w')
|
#Write nodes json
|
||||||
|
nodes_json = open(options['destination_directory'] + '/nodes.json.new','w')
|
||||||
nodes_json.write(m.build())
|
nodes_json.write(m.build())
|
||||||
nodes_json.close()
|
nodes_json.close()
|
||||||
|
|
||||||
|
#Move to destination
|
||||||
|
os.rename(options['destination_directory'] + '/nodes.json.new',options['destination_directory'] + '/nodes.json')
|
||||||
|
|
Loading…
Reference in New Issue