allow force for pkglist_add

Using force option will allow 'pre-blocking' of packages which are not
in tag inheritance yet, but could cause a problem if they'll get to
inheritance chain somehow. In such case we don't have an owner for
package and using 'force' allows admin to introduce blocked package with
him as an owner.

Fixes: https://pagure.io/koji/issue/867
This commit is contained in:
Tomas Kopecek 2018-04-03 13:41:01 +02:00 committed by Mike McLean
parent 77ae912fad
commit 63d92398d5
4 changed files with 415 additions and 16 deletions

View file

@ -364,6 +364,7 @@ def handle_block_pkg(goptions, session, args):
usage = _("usage: %prog block-pkg [options] tag package [package2 ...]")
usage += _("\n(Specify the --help global option for a list of other help options)")
parser = OptionParser(usage=usage)
parser.add_option("--force", action='store_true', default=False, help=_("Override blocks and owner if necessary"))
(options, args) = parser.parse_args(args)
if len(args) < 2:
parser.error(_("Please specify a tag and at least one package"))
@ -386,7 +387,7 @@ def handle_block_pkg(goptions, session, args):
return ret
session.multicall = True
for package in args[1:]:
session.packageListBlock(tag, package)
session.packageListBlock(tag, package, force=options.force)
session.multiCall(strict=True)