only allow admins to perform non-scratch builds from srpm

This commit is contained in:
Mike Bonnet 2007-06-05 00:39:21 -04:00
parent c4df08125d
commit 79ef5b41f2
2 changed files with 9 additions and 0 deletions

View file

@ -598,6 +598,10 @@ def handle_build(options, session, args):
#relative to koji.PRIO_DEFAULT
priority = 5
if not source.startswith('cvs://'):
# only allow admins to perform non-scratch builds from srpm
if not opts['scratch'] and not session.hasPerm('admin'):
parser.error(_("builds from srpm must use --scratch"))
assert False
#treat source as an srpm and upload it
print "Uploading srpm: %s" % source
serverdir = _unique_path('cli-build')