cli: sidetag --suffix option
This commit is contained in:
parent
21a454f14c
commit
350086df4e
2 changed files with 13 additions and 2 deletions
|
|
@ -33,15 +33,26 @@ def handle_add_sidetag(options, session, args):
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--debuginfo", action="store_true", help=_("Buildroot repo will contain debuginfos")
|
"--debuginfo", action="store_true", help=_("Buildroot repo will contain debuginfos")
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--suffix", actions="store", help=_("Suffix from hub-supported ones")
|
||||||
|
)
|
||||||
|
|
||||||
opts = parser.parse_args(args)
|
opts = parser.parse_args(args)
|
||||||
|
|
||||||
activate_session(session, options)
|
activate_session(session, options)
|
||||||
|
|
||||||
|
kwargs = {"debuginfo": opts.debuginfo}
|
||||||
|
if opts.suffix:
|
||||||
|
kwargs['suffix'] = opts.suffix
|
||||||
try:
|
try:
|
||||||
tag = session.createSideTag(opts.basetag, debuginfo=opts.debuginfo)
|
tag = session.createSideTag(opts.basetag, **kwargs)
|
||||||
except koji.ActionNotAllowed:
|
except koji.ActionNotAllowed:
|
||||||
parser.error(_("Policy violation"))
|
parser.error(_("Policy violation"))
|
||||||
|
except koji.ParameterError as ex:
|
||||||
|
if 'suffix' in str(ex):
|
||||||
|
parser.error(_("Hub is older and doesn't support --suffix, please run it without it"))
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
if not opts.quiet:
|
if not opts.quiet:
|
||||||
print(tag["name"])
|
print(tag["name"])
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,4 @@
|
||||||
# automatically remove sidetag on untagging last package
|
# automatically remove sidetag on untagging last package
|
||||||
remove_empty = off
|
remove_empty = off
|
||||||
# potential suffixes for sidetag names
|
# potential suffixes for sidetag names
|
||||||
allowed_suffixes = stack-gate
|
# allowed_suffixes =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue