From a78d67017e7c0aee98261751bfb4eb1815fa2bb1 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Thu, 26 Nov 2009 10:15:42 -0500 Subject: [PATCH] Pass a mode to os.fdopen in invirt-build-conf and invirt-submit-build. By default, os.fdopen opens files in read-only mode. svn path=/trunk/packages/invirt-dev/; revision=2569 --- invirt-build-conf | 4 ++-- invirt-submit-build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/invirt-build-conf b/invirt-build-conf index 7ebd542..b5a8d3d 100755 --- a/invirt-build-conf +++ b/invirt-build-conf @@ -30,14 +30,14 @@ def main(): # a temporary path and moved to its final resting place on # .close(). Oh well. conf_fd, conf_name = tempfile.mkstemp() - conf = os.fdopen(conf_fd) + conf = os.fdopen(conf_fd, 'r+') build_handler = '/usr/sbin/invirt-submit-build' for pocket in config.git.pockets: acl = authz.expandAdmin(getattr(config.git.pockets, pocket).acl, None) acl_fd, acl_name = tempfile.mkstemp() - acl_fd = os.fdopen(acl_fd) + acl_fd = os.fdopen(acl_fd, 'r+') print >>acl_fd, '\n'.join(userToPrinc(a) for a in acl) acl_path = os.path.join('/etc/remctl/acl/build-%s' % pocket) diff --git a/invirt-submit-build b/invirt-submit-build index 713f3da..7115bf6 100755 --- a/invirt-submit-build +++ b/invirt-submit-build @@ -44,7 +44,7 @@ def main(): # written the file out, first write the queue entry to a temporary # file, and then move it into the queue directory. q_fd, q_name = tempfile.mkstemp() - q = os.fdopen(q_fd) + q = os.fdopen(q_fd, 'r+') print >>q, "%s %s %s %s" % (pocket, package, commit, principal) os.rename(q_name, q_path) -- 1.7.9.5