diff options
author | Jesse Keating <jkeating@redhat.com> | 2010-02-01 16:33:38 -0800 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2010-02-01 16:33:38 -0800 |
commit | 799ebd989805e2dc4ba00ecdfbbc0c43eccababe (patch) | |
tree | c1aec8595187f7660b6cccd7548a301231ccb1dc /src | |
parent | 62c80616404732ecd6a864bb913e95e956b5f6f6 (diff) | |
download | fedora-packager-799ebd989805e2dc4ba00ecdfbbc0c43eccababe.tar.gz fedora-packager-799ebd989805e2dc4ba00ecdfbbc0c43eccababe.tar.xz fedora-packager-799ebd989805e2dc4ba00ecdfbbc0c43eccababe.zip |
Wire up the build task the rest of the way
This also makes use of the new cert library which needs some work still,
so this code is somewhat fragile if you don't have proper certs.
Diffstat (limited to 'src')
-rwxr-xr-x | src/fedpkg.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py index 08739d5..d7222ec 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -231,15 +231,30 @@ Running Tasks: return rv def build(args): + if not args.user: + # Doing a try doesn't really work since the fedora_cert library just + # exits on error, but if that gets fixed this will work better. + try: + args.user = fedora_cert.read_user_cert() + except: + log.debug('Could not read Fedora cert, using login name') + args.user = os.getlogin() # Need to do something with BUILD_FLAGS or KOJI_FLAGS here for compat try: mymodule = fedpkg.PackageModule(args.path) kojiconfig = _get_secondary_config(mymodule) - return mymodule.build(args.skip_tag, args.scratch, args.nowait, - args.q, args.background, kojiconfig) + task_id = mymodule.build(args.user, args.skip_tag, args.scratch, + args.background, kojiconfig) except fedpkg.FedpkgError, e: log.error('Could not build: %s' % e) sys.exit(1) + # Now that we have the task ID we need to deal with it. + if args.nowait: + # Log out of the koji session + mymodule.kojisession.logout() + return + # pass info off to our koji task watcher + return _watch_koji_tasks(mymodule.kojisession, [task_id], quiet=args.q) def chainbuild(args): # not implimented |