From 946a8d874c5194224c8b8b0739f170d967ba7c83 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 25 Nov 2015 09:27:10 +0100 Subject: [PATCH] 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. --- run-autopkgtest | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/run-autopkgtest b/run-autopkgtest index f1a02f6..d46005f 100755 --- a/run-autopkgtest +++ b/run-autopkgtest @@ -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: