Pass a mode to os.fdopen in invirt-build-conf and invirt-submit-build.
[invirt/packages/invirt-dev.git] / invirt-build-conf
index 7ebd542..b5a8d3d 100755 (executable)
@@ -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)