add remove-tag admin command
This commit is contained in:
parent
5f06bb6bf2
commit
b2c013db7e
1 changed files with 24 additions and 0 deletions
24
cli/koji
24
cli/koji
|
|
@ -2691,6 +2691,30 @@ def handle_remove_target(options, session, args):
|
|||
|
||||
session.deleteBuildTarget(target)
|
||||
|
||||
def handle_remove_tag(options, session, args):
|
||||
"[admin] Remove a tag"
|
||||
usage = _("usage: %prog remove-tag [options] name")
|
||||
usage += _("\n(Specify the --help global option for a list of other help options)")
|
||||
parser = OptionParser(usage=usage)
|
||||
(options, args) = parser.parse_args(args)
|
||||
|
||||
if len(args) != 1:
|
||||
parser.error(_("Please specify a tag to remove"))
|
||||
assert False
|
||||
activate_session(session)
|
||||
|
||||
if not session.hasPerm('admin'):
|
||||
print "This action requires admin privileges"
|
||||
return
|
||||
|
||||
tag = args[0]
|
||||
tag_info = session.getTag(tag)
|
||||
if not tag_info:
|
||||
print "Tag %s does not exist" % tag
|
||||
return 1
|
||||
|
||||
session.deleteTag(tag_info['id'])
|
||||
|
||||
def anon_handle_list_targets(options, session, args):
|
||||
"List the build targets"
|
||||
usage = _("usage: %prog list-targets [options]")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue