Override manifest file only after it is fully written to disk.
We called "Override()" before closing the file passed in argument.
Change-Id: I15adb99deb14297ef72fcb1b0945eb246f172fb0
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 67213d3..613cc81 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -226,13 +226,13 @@
f = open(manifest_path, 'w')
try:
f.write(manifest_str)
- self.manifest.Override(manifest_name)
finally:
f.close()
except IOError:
print >>sys.stderr, 'error: cannot write manifest to %s' % \
manifest_path
sys.exit(1)
+ self.manifest.Override(manifest_name)
else:
print >>sys.stderr, 'error: %s' % manifest_str
sys.exit(1)