#896 fix reference source -> src for build task in make_task
Closed 5 years ago by julian8628. Opened 6 years ago by julian8628.
julian8628/koji make_task_ref  into  master

file modified
+3 -3
@@ -516,9 +516,9 @@ 

          policy_data['req_channel'] = opts['channel']

          req_channel_id = get_channel_id(opts['channel'], strict=True)

      if method == 'build':

-         # arglist = source, target, [opts]

-         args = koji.decode_args2(arglist, ('source', 'target', 'opts'))

-         policy_data['source'] = args['source']

+         # arglist = src, target, [opts]

+         args = koji.decode_args2(arglist, ('src', 'target', 'opts'))

+         policy_data['source'] = args['src']

          if args['target'] is None:

              #koji-shadow makes null-target builds

              policy_data['target'] = None

to keep the consistence with BuildTask.handler()
For example:
if passing arglist as [{'__starstar': True, 'src': 'git://pkgs.devel.redhat.com/rpms/sed/#origin/rhel-6.9', 'target': 'build-target-rhel-6.9-build-m6ww', 'opts': {'scratch': True, 'repo_id': 171}}]

Fault: <Fault 1: "<type 'exceptions.KeyError'>: 'source'">

will be thrown

But, It's not important for current functionality, since only tuple style args are accepted now.
It's only an insignificant change

If we're going to touch this, probably better to use parse_task_params().

Pull-Request has been closed by julian8628

5 years ago