aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/mgagit
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-01-04 14:50:36 +0000
committerColin Guthrie <colin@mageia.org>2014-01-04 14:50:36 +0000
commitd53596770d004fc035ca311c86a54f4c01412b8f (patch)
tree7601fb72b1e3d26c31d8ac2c1791f03401b281db /deployment/mgagit
parent9c69307af05b4e50e15f2b8dfc12ce9129e79394 (diff)
downloadpuppet-d53596770d004fc035ca311c86a54f4c01412b8f.tar
puppet-d53596770d004fc035ca311c86a54f4c01412b8f.tar.gz
puppet-d53596770d004fc035ca311c86a54f4c01412b8f.tar.bz2
puppet-d53596770d004fc035ca311c86a54f4c01412b8f.tar.xz
puppet-d53596770d004fc035ca311c86a54f4c01412b8f.zip
mgagit: Fix last-modified file write.
Diffstat (limited to 'deployment/mgagit')
-rwxr-xr-xdeployment/mgagit/templates/git-post-receive-hook6
1 files changed, 4 insertions, 2 deletions
diff --git a/deployment/mgagit/templates/git-post-receive-hook b/deployment/mgagit/templates/git-post-receive-hook
index e5c60f39..f0e71619 100755
--- a/deployment/mgagit/templates/git-post-receive-hook
+++ b/deployment/mgagit/templates/git-post-receive-hook
@@ -176,8 +176,10 @@ if __name__ == '__main__':
lastupdated = git_multimail.read_git_output(
['for-each-ref', '--sort=-committerdate', "--format='%(committerdate:iso8601)'", '--count=1', 'refs/heads'],
)
- open(os.path.join(infowebdir, 'last-modified'), 'w').write(lastupdated).close()
- except IOError:
+ modfile = open(os.path.join(infowebdir, 'last-modified'), 'w')
+ modfile.write(lastupdated)
+ modfile.close()
+ except Exception:
pass
git_multimail.main(sys.argv[1:])