- acl = authz.expandAdmin(getattr(config.build.pockets, pocket).acl, None)
-
- acl_fd, acl_name = tempfile.mkstemp()
- acl_fd = os.fdopen(acl_fd, 'r+')
- print >>acl_fd, '\n'.join(userToPrinc(a) for a in acl)
-
- all_devs.update(set(userToPrinc(a) for a in acl))
-
- acl_path = os.path.join('/etc/remctl/acl/build-%s' % pocket)
+ acl = authz.expandAdmin(getattr(config.build.pockets, pocket).acl)
+ with atomic_write(acl_path(pocket)) as f:
+ princs = [userToPrinc(a) for a in acl]
+ print >>f, '\n'.join(princs)
+ all_devs.update(set(princs))