mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-03 21:36:15 +01:00
The 'token --trigger' command no longer sets '--operation=runservice' by default.
The operation is bound to the token on the server. We no longer have to specify it during trigger. If we still specify it, the only benefit is double-checking the operation that is set on the client and verified on the server.
This commit is contained in:
parent
d0d25ff5de
commit
933040425c
@ -1659,7 +1659,7 @@ class Osc(cmdln.Cmdln):
|
|||||||
@cmdln.option('-d', '--delete', metavar='TOKENID',
|
@cmdln.option('-d', '--delete', metavar='TOKENID',
|
||||||
help='Delete a token')
|
help='Delete a token')
|
||||||
@cmdln.option('-o', '--operation', metavar='OPERATION',
|
@cmdln.option('-o', '--operation', metavar='OPERATION',
|
||||||
help='Default is "runservice", but "branch", "release", "rebuild", or "workflow" can also be used')
|
help="Operation associated with the token. Choices: runservice, branch, release, rebuild, workflow")
|
||||||
@cmdln.option('-t', '--trigger', metavar='TOKENSTRING',
|
@cmdln.option('-t', '--trigger', metavar='TOKENSTRING',
|
||||||
help='Trigger the action of a token')
|
help='Trigger the action of a token')
|
||||||
@cmdln.option('', '--scm-token', metavar='SCM_TOKEN',
|
@cmdln.option('', '--scm-token', metavar='SCM_TOKEN',
|
||||||
@ -1718,12 +1718,14 @@ class Osc(cmdln.Cmdln):
|
|||||||
http_DELETE(url)
|
http_DELETE(url)
|
||||||
elif opts.trigger:
|
elif opts.trigger:
|
||||||
print("Trigger token")
|
print("Trigger token")
|
||||||
operation = opts.operation or "runservice"
|
|
||||||
query = {}
|
query = {}
|
||||||
if len(args) > 1:
|
if len(args) > 1:
|
||||||
query['project'] = args[0]
|
query['project'] = args[0]
|
||||||
query['package'] = args[1]
|
query['package'] = args[1]
|
||||||
url = makeurl(apiurl, ['trigger', operation], query)
|
if opts.operation:
|
||||||
|
url = makeurl(apiurl, ["trigger", opts.operation], query)
|
||||||
|
else:
|
||||||
|
url = makeurl(apiurl, ["trigger"], query)
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Type': 'application/octet-stream',
|
'Content-Type': 'application/octet-stream',
|
||||||
'Authorization': "Token " + opts.trigger,
|
'Authorization': "Token " + opts.trigger,
|
||||||
|
Loading…
Reference in New Issue
Block a user