diff --git a/plugins/hub/protonmsg.py b/plugins/hub/protonmsg.py index f1b9864c..417c2f4e 100644 --- a/plugins/hub/protonmsg.py +++ b/plugins/hub/protonmsg.py @@ -196,6 +196,8 @@ def prep_import(cbtype, *args, **kws): @convert_datetime @callback('postRPMSign') def prep_rpm_sign(cbtype, *args, **kws): + if not kws['sigkey']: + return address = 'sign.rpm' props = {'type': cbtype[4:], 'sigkey': kws['sigkey'], diff --git a/tests/test_plugins/test_protonmsg.py b/tests/test_plugins/test_protonmsg.py index 5709a36d..a223bd61 100644 --- a/tests/test_plugins/test_protonmsg.py +++ b/tests/test_plugins/test_protonmsg.py @@ -123,6 +123,18 @@ class TestProtonMsg(unittest.TestCase): rpm_version=rpm['version'], rpm_release=rpm['release'], **build) + def test_prep_rpm_sign_no_sigkey(self): + build = {'name': 'test-pkg', + 'version': '1.0', + 'release': '1'} + rpm = {'name': 'test-pkg-subpkg', + 'version': '2.0', + 'release': '2'} + sigkey = '' + protonmsg.prep_rpm_sign('postRPMSign', sigkey=sigkey, sighash='fedcba9876543210', + build=build, rpm=rpm) + self.assertFalse(hasattr(context, 'protonmsg_msgs')) + def test_prep_tag(self): build = {'name': 'test-pkg', 'version': '1.0', 'release': '1'} protonmsg.prep_tag('postTag', tag={'name': 'test-tag'},