PR#3124: Update error message in make task when channel not exist

Merges #3124
https://pagure.io/koji/pull-request/3124

Fixes: #3125
https://pagure.io/koji/issue/3125
Update make_task error message when channel not exist to more readability
This commit is contained in:
Tomas Kopecek 2021-11-15 09:06:28 +01:00
commit 676b3b5ddc

View file

@ -569,7 +569,9 @@ def make_task(method, arglist, **opts):
policy_data['user_id'] = opts['owner']
if 'channel' in opts:
policy_data['req_channel'] = opts['channel']
channel_info = get_channel(opts['channel'], strict=True)
channel_info = get_channel(opts['channel'])
if not channel_info:
raise koji.GenericError('No such channel: %s' % opts['channel'])
if channel_info['enabled']:
req_channel_id = channel_info['id']
else: