- acl_path = os.path.join('/etc/remctl/acl/build-%s' % pocket)
-
- os.rename(acl_fd.name, acl_path)
- print >>conf, 'build %s %s %s' % (pocket, build_handler, acl_path)
-
- os.rename(conf, '/etc/remctl/conf.d/build')
+def main():
+ all_devs = set()
+ build_handler = '/usr/bin/invirt-submit-build'
+
+ for pocket in config.build.pockets:
+ 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))
+
+ with atomic_write('/etc/remctl/conf.d/build') as f:
+ for pocket in config.build.pockets:
+ print >>f, 'build %s %s %s' % (pocket, build_handler, acl_path(pocket))
+
+ with atomic_write('/etc/remctl/acl/repo_admin') as f:
+ acl = authz.expandAdmin(config.build.repo_admin)
+ print >>f, '\n'.join(userToPrinc(a) for a in acl)
+
+ with atomic_write('/etc/remctl/conf.d/repo_admin') as f:
+ print >>f, 'create repo /usr/bin/invirt-add-repo /etc/remctl/acl/repo_admin'
+
+ with atomic_write(os.path.join(builder._REPO_DIR, '.k5login')) as f:
+ if 'repo_access' in config.build:
+ acl = authz.expandAdmin(config.build.repo_access)
+ princs = [userToPrinc(a) for a in acl]
+ all_devs.update(set(princs))
+ print >>f, '\n'.join(all_devs)