[PATCH] Add new {pre,post}RPMSign plugin callbacks.
by Ralph Bean
I'd like to use these in Fedora Infrastructure for the fedmsg plugin so
we can see when rawhide rpms get signed by sigul.
---
hub/kojihub.py | 6 ++++++
koji/plugin.py | 2 ++
2 files changed, 8 insertions(+)
diff --git a/hub/kojihub.py b/hub/kojihub.py
index 3c7d5c1..1f8c0e2 100644
--- a/hub/kojihub.py
+++ b/hub/kojihub.py
@@ -24,6 +24,7 @@
import base64
import calendar
import cgi
+import copy
import koji
import koji.auth
import koji.db
@@ -5152,6 +5153,10 @@ def add_rpm_sig(an_rpm, sighdr):
#TODO[?] - if sighash is the same, handle more gracefully
nvra = "%(name)s-%(version)s-%(release)s.%(arch)s" % rinfo
raise koji.GenericError, "Signature already exists for package %s, key %s" % (nvra, sigkey)
+ callback_info = copy.copy(rinfo)
+ callback_info['sigkey'] = sigkey
+ callback_info['sighash'] = sighash
+ koji.plugin.run_callbacks('preRPMSign', attribute='sighash', old=None, new=sighash, info=callback_info)
insert = """INSERT INTO rpmsigs(rpm_id, sigkey, sighash)
VALUES (%(rpm_id)s, %(sigkey)s, %(sighash)s)"""
_dml(insert, locals())
@@ -5161,6 +5166,7 @@ def add_rpm_sig(an_rpm, sighdr):
fo = file(sigpath, 'wb')
fo.write(sighdr)
fo.close()
+ koji.plugin.run_callbacks('postRPMSign', attribute='sighash', old=None, new=sighash, info=callback_info)
def _scan_sighdr(sighdr, fn):
"""Splices sighdr with other headers from fn and queries (no payload)"""
diff --git a/koji/plugin.py b/koji/plugin.py
index ed51a5c..975b297 100644
--- a/koji/plugin.py
+++ b/koji/plugin.py
@@ -35,6 +35,8 @@ callbacks = {
'postBuildStateChange': [],
'preImport': [],
'postImport': [],
+ 'preRPMSign': [],
+ 'postRPMSign': [],
'preTag': [],
'postTag': [],
'preUntag': [],
--
1.9.3
9 years, 3 months
Mock documentation
by Miroslav Suchý
I started editing:
https://fedoraproject.org/wiki/Projects/Mock
And I learned about several plugins, but I'm still not sure what some plugins are exactly doing.
If you know that, or you are even the author of that plugin, I would be very glad, if you can spare few minutes and
enhance the documentation:
https://fedoraproject.org/wiki/Projects/Mock#Plugins
Thanks
--
Miroslav Suchy, RHCE, RHCDS
Red Hat, Senior Software Engineer, #brno, #devexp, #fedora-buildsys
9 years, 3 months
Re: Fixing livecd ISO labels (bz 1145264)
by Matthew Miller
On Tue, Nov 18, 2014 at 08:46:54AM -0800, Brian C. Lane wrote:
> This kind of information doesn't belong in livecd-creator. You can pass
> it a volume id. Koji knows (or should know) what it is building, it
> should construct the correct name and pass it. The default in
> livecd-creator is just a default and is used to match up the isolinux
> config with the image for booting, which is working just fine.
>
> Also, can we stop with the quick fixes? They live forever, so let's do
> this the right way.
Agree in general, but a) sometimes, that's where we are, and b) as I
understand it, the F22 plan is to use imagefactory and/or
livemedia-creator rather than livecd creator, so it really is
short-lived.
--
Matthew Miller
<mattdm(a)fedoraproject.org>
Fedora Project Leader
9 years, 4 months
Re: Fixing livecd ISO labels (bz 1145264)
by Cole Robinson
Fixing buildsys CC
On 11/15/2014 01:29 PM, Cole Robinson wrote:
> Hi all,
>
> The ISO volume ID for the Fedora 21 workstation livecd is
> 'Fedora-Live-Workstation-x86_64-2', which doesn't actually say 21 in it, and
> libosinfo can't use it to detect the fedora version for boxes/virt-manager.
>
> Koji is responsible for generating the volume ID, and there's a bug filed:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1145264
>
> I also sent a (untested) koji patch to buildsys list:
>
> https://lists.fedoraproject.org/pipermail/buildsys/2014-October/004411.html
>
> However neither have received a response, so I'm reaching out here.
>
> If this isn't fixed before F21 GA, we are stuck with the crappy volume ID
> forever and tools that are depending on it are in a tough spot. Is there any
> process to escalate this and get the fix deployed to infrastructure? (FWIW
> I've just proposed the bug as a freeze exception, but presumably it will take
> more coordination that that)
>
> Thanks,
> Cole
9 years, 4 months
[PATCH] enhancements to rpkg
by Mike Bonnet
Hi. Attached are a couple of enhancements to rpkg. The first adds a
--runas option. This allows you to run Koji commands as a different
user, if the Koji hub has been configured to allow you to do so. This
is useful for automation that launches builds on behalf of other users.
The other patch fixes support for password authentication (it has
never worked correctly) and cleans up Koji session creation, so all
relevant config options are passed through to the new session. This
should improve compatibility between the Koji cli and rpkg. Let me know
if there are any questions.
Thanks,
Mike
9 years, 4 months
[PATCH] RPKG: run os.expanduser on the kojiconfig attribute
by Brian Stinson
Sites could specify a path in the user's home directory for the
kojiconfig attribute (e.g. ~/.koji/config-cbs). This is a one-line
change to run os.expanduser() on that path so that file doesn't get
skipped when loading the koji session attributes.
Brian
--
Brian Stinson
bstinson(a)ksu.edu | IRC: bstinson | Bitbucket/Twitter: bstinsonmhk
9 years, 4 months