[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] cgi-bin/schedule: fix parsing and passing of selector options
Mattia Rizzolo
gitlab at salsa.debian.org
Fri Nov 9 12:47:33 GMT 2018
Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net
Commits:
641cfb29 by Mattia Rizzolo at 2018-11-09T12:47:20Z
cgi-bin/schedule: fix parsing and passing of selector options
Signed-off-by: Mattia Rizzolo <mattia at debian.org>
- - - - -
1 changed file:
- bin/cgi-bin/schedule
Changes:
=====================================
bin/cgi-bin/schedule
=====================================
@@ -15,7 +15,8 @@ cgitb.enable()
def debug_info():
# Debug info, to be removed once ready to go.
print()
- print('WARNING: This endpoint is still a WORK IN PROGRESS. This means that the option details may change without notice.')
+ print('WARNING: This endpoint is still a WORK IN PROGRESS. '
+ 'This means that the option details may change without notice.')
print('You are authenticated as: {}'.format(user))
print(cgi.FieldStorage())
@@ -38,8 +39,9 @@ def sanify_field(field_name, field_text):
err = '"{}" is not sane (does not match {})'.format(field_name, sane_re)
raise ValidationError(err)
+
def validate(form):
- if 'pkg' not in form:
+ if not any(x in form for x in ('pkg', 'status', 'issue', 'after', 'before')):
raise ValidationError('no packages specified')
for pkg in form.getlist('pkg'):
sanify_field('pkg', pkg)
@@ -67,7 +69,7 @@ def validate(form):
value = form.getvalue(opt)
if value:
sanify_field(opt, value)
- args.append('--{} {}'.format(opt, value))
+ args.extend(('--{}'.format(opt), value))
for f in ('suite', 'architecture'):
for i in form.getlist(f):
sanify_field(f, i)
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/641cfb29f05e3024b3392a4e6dd3f3341f90df07
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/641cfb29f05e3024b3392a4e6dd3f3341f90df07
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20181109/e77d5344/attachment-0001.html>
More information about the Qa-jenkins-scm
mailing list