projects
/
invirt/packages/invirt-dev.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
When validating builds, return True if the build validates, and don't
[invirt/packages/invirt-dev.git]
/
invirt-build-conf
diff --git
a/invirt-build-conf
b/invirt-build-conf
index
b5a8d3d
..
d43bc7c
100755
(executable)
--- a/
invirt-build-conf
+++ b/
invirt-build-conf
@@
-3,14
+3,16
@@
"""Re-generate the remctl configuration for build submissions.
This script generates the remctl ACL and configuration for each build
"""Re-generate the remctl configuration for build submissions.
This script generates the remctl ACL and configuration for each build
-pocket defined in the configuration.
+pocket defined in the configuration. It also updates the .k5login for
+the git user that developers can push through.
"""
import os
import tempfile
"""
import os
import tempfile
-from invirt.authz import mech as authz
+from invirt import authz
+from invirt import builder
from invirt.config import structs as config
from invirt.config import structs as config
@@
-26,20
+28,24
@@
def userToPrinc(user):
def main():
def main():
+ all_devs = set()
+
# Python could really use a file-like object that gets written to
# 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, 'r+')
# Python could really use a file-like object that gets written to
# 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, 'r+')
- build_handler = '/usr/sbin/invirt-submit-build'
+ build_handler = '/usr/bin/invirt-submit-build'
- for pocket in config.git.pockets:
- acl = authz.expandAdmin(getattr(config.git.pockets, pocket).acl, None)
+ for pocket in config.build.pockets:
+ 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)
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)
os.rename(acl_name, acl_path)
acl_path = os.path.join('/etc/remctl/acl/build-%s' % pocket)
os.rename(acl_name, acl_path)
@@
-47,6
+53,12
@@
def main():
os.rename(conf_name, '/etc/remctl/conf.d/build')
os.rename(conf_name, '/etc/remctl/conf.d/build')
+ k5login_fd, k5login_name = tempfile.mkstemp()
+ k5login = os.fdopen(k5login_fd, 'r+')
+ print >>k5login, '\n'.join(all_devs)
+
+ os.rename(k5login_name, os.path.join(builder._REPO_DIR, '.k5login'))
+
if __name__ == '__main__':
main()
if __name__ == '__main__':
main()