mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-23 08:21:30 +00:00
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.
This commit is contained in:
parent
8f70520823
commit
946a8d874c
@ -27,8 +27,10 @@ def parse_args():
|
|||||||
metavar='SOURCE/VERSION', required=True,
|
metavar='SOURCE/VERSION', required=True,
|
||||||
help='Add triggering package to request. '
|
help='Add triggering package to request. '
|
||||||
'Can be specified multiple times.')
|
'Can be specified multiple times.')
|
||||||
parser.add_argument('--ppa', metavar='LPUSER/PPANAME',
|
parser.add_argument('--ppa', metavar='LPUSER/PPANAME', action='append',
|
||||||
help='Enable PPA for requested test(s)')
|
default=[],
|
||||||
|
help='Enable PPA for requested test(s). '
|
||||||
|
'Can be specified multiple times.')
|
||||||
parser.add_argument('package', nargs='+',
|
parser.add_argument('package', nargs='+',
|
||||||
help='Source package name(s) whose tests to run.')
|
help='Source package name(s) whose tests to run.')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@ -40,6 +42,13 @@ def parse_args():
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
parser.error('Invalid trigger format "%s", must be "sourcepkg/version"' % t)
|
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
|
return args
|
||||||
|
|
||||||
|
|
||||||
@ -65,7 +74,7 @@ if __name__ == '__main__':
|
|||||||
if args.trigger:
|
if args.trigger:
|
||||||
params['triggers'] = args.trigger
|
params['triggers'] = args.trigger
|
||||||
if args.ppa:
|
if args.ppa:
|
||||||
params['ppa'] = args.ppa
|
params['ppas'] = args.ppa
|
||||||
params = '\n' + json.dumps(params)
|
params = '\n' + json.dumps(params)
|
||||||
|
|
||||||
with kombu.Connection(config.adt_amqp) as conn:
|
with kombu.Connection(config.adt_amqp) as conn:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user