run-autopkgtest: Accept multiple --ppa options, adjust AMQP parameter

Adjust to AMQP request API change for PPAs:

  https://git.launchpad.net/~ubuntu-release/+git/autopkgtest-cloud/commit/?id=ed35358

Accept multiple --ppa options and submit them as list to the "ppas" test
parameter.
bzr-import-20160707
Martin Pitt 9 years ago
parent 8f70520823
commit 946a8d874c

@ -27,8 +27,10 @@ def parse_args():
metavar='SOURCE/VERSION', required=True,
help='Add triggering package to request. '
'Can be specified multiple times.')
parser.add_argument('--ppa', metavar='LPUSER/PPANAME',
help='Enable PPA for requested test(s)')
parser.add_argument('--ppa', metavar='LPUSER/PPANAME', action='append',
default=[],
help='Enable PPA for requested test(s). '
'Can be specified multiple times.')
parser.add_argument('package', nargs='+',
help='Source package name(s) whose tests to run.')
args = parser.parse_args()
@ -40,6 +42,13 @@ def parse_args():
except ValueError:
parser.error('Invalid trigger format "%s", must be "sourcepkg/version"' % t)
# verify syntax of PPAs
for t in args.ppa:
try:
(user, name) = t.split('/')
except ValueError:
parser.error('Invalid ppa format "%s", must be "lpuser/ppaname"' % t)
return args
@ -65,7 +74,7 @@ if __name__ == '__main__':
if args.trigger:
params['triggers'] = args.trigger
if args.ppa:
params['ppa'] = args.ppa
params['ppas'] = args.ppa
params = '\n' + json.dumps(params)
with kombu.Connection(config.adt_amqp) as conn:

Loading…
Cancel
Save