diff options
author | 2014-01-24 16:38:02 -0500 | |
---|---|---|
committer | 2014-01-24 22:15:36 -0500 | |
commit | 832ef59a5e80f7792ddcbaec5730c701078ac621 (patch) | |
tree | 9a29ea44a69d18cca95d9ed043132484133217ba | |
parent | WebappConfig/config.py: Fixes spacing issue in --help output. (diff) | |
download | webapp-config-832ef59a5e80f7792ddcbaec5730c701078ac621.tar.gz webapp-config-832ef59a5e80f7792ddcbaec5730c701078ac621.tar.bz2 webapp-config-832ef59a5e80f7792ddcbaec5730c701078ac621.zip |
WebappConfig/db.py: Properly closes install file after writing.
When webapp-config cleans out a webapp installation it needs to
remove the database entry of the file from it's designated installs
file. If more than one database entry is in the installs file it
should still list the database entry for the webapp that isn't being
removed. The logic is all there in db.py but after the file has
rewritten the entries it doesn't close the file properly and causes
a failure in the check right after the write(), which then unlinks
the installs file and removes the entries from webapp-config's
database.
X-Gentoo-Bug:494520
X-Gentoo-Bug-URL: https://bugs.gentoo.org/494520
-rw-r--r-- | WebappConfig/db.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/WebappConfig/db.py b/WebappConfig/db.py index 228b2c8..2d70cb9 100644 --- a/WebappConfig/db.py +++ b/WebappConfig/db.py @@ -340,6 +340,7 @@ class WebappDB(AppHierarchy): if not self.__p: installs = open(dbpath, 'w') installs.write('\n'.join(newentries) + '\n') + installs.close() if not self.has_installs(): os.unlink(dbpath) else: |