Fix autohold RPC protocol
Do not use _name suffix in parameter names in the RPC protocol, for consistency. Change-Id: I221ec29260cd0a632b0c56b2d192537afc931b02
This commit is contained in:
parent
36b2adf52a
commit
cc6d2fdcd1
|
@ -155,9 +155,9 @@ class Client(zuul.cmd.ZuulApp):
|
|||
def autohold(self):
|
||||
client = zuul.rpcclient.RPCClient(
|
||||
self.server, self.port, self.ssl_key, self.ssl_cert, self.ssl_ca)
|
||||
r = client.autohold(tenant_name=self.args.tenant,
|
||||
project_name=self.args.project,
|
||||
job_name=self.args.job,
|
||||
r = client.autohold(tenant=self.args.tenant,
|
||||
project=self.args.project,
|
||||
job=self.args.job,
|
||||
reason=self.args.reason,
|
||||
count=self.args.count)
|
||||
return r
|
||||
|
|
|
@ -48,10 +48,10 @@ class RPCClient(object):
|
|||
self.log.debug("Job complete, success: %s" % (not job.failure))
|
||||
return job
|
||||
|
||||
def autohold(self, tenant_name, project_name, job_name, reason, count):
|
||||
data = {'tenant_name': tenant_name,
|
||||
'project_name': project_name,
|
||||
'job_name': job_name,
|
||||
def autohold(self, tenant, project, job, reason, count):
|
||||
data = {'tenant': tenant,
|
||||
'project': project,
|
||||
'job': job,
|
||||
'reason': reason,
|
||||
'count': count}
|
||||
return not self.submitJob('zuul:autohold', data).failure
|
||||
|
|
|
@ -94,23 +94,23 @@ class RPCListener(object):
|
|||
args = json.loads(job.arguments)
|
||||
params = {}
|
||||
|
||||
tenant = self.sched.abide.tenants.get(args['tenant_name'])
|
||||
tenant = self.sched.abide.tenants.get(args['tenant'])
|
||||
if tenant:
|
||||
params['tenant_name'] = args['tenant_name']
|
||||
params['tenant_name'] = args['tenant']
|
||||
else:
|
||||
error = "Invalid tenant: %s" % args['tenant_name']
|
||||
error = "Invalid tenant: %s" % args['tenant']
|
||||
job.sendWorkException(error.encode('utf8'))
|
||||
return
|
||||
|
||||
(trusted, project) = tenant.getProject(args['project_name'])
|
||||
(trusted, project) = tenant.getProject(args['project'])
|
||||
if project:
|
||||
params['project_name'] = project.canonical_name
|
||||
else:
|
||||
error = "Invalid project: %s" % args['project_name']
|
||||
error = "Invalid project: %s" % args['project']
|
||||
job.sendWorkException(error.encode('utf8'))
|
||||
return
|
||||
|
||||
params['job_name'] = args['job_name']
|
||||
params['job_name'] = args['job']
|
||||
params['reason'] = args['reason']
|
||||
|
||||
if args['count'] < 0:
|
||||
|
|
Loading…
Reference in New Issue