@@ -0,0 +1,1181 @@
+#!/usr/bin/env python%0A%0Aimport requests%0Aimport json%0Aimport sys%0Aimport argparse%0A%0Aparser = argparse.ArgumentParser('Queries Monorail to get the services and deployNotes where a list of Pull requests will be deployed')%0Aparser.add_argument('--url', help='URL where Monorail is located')%0Aparser.add_argument('--pr', help='List of pull requests we will ask for')%0Aargs = parser.parse_args()%0A%0Acurl_uri = '/deploy-info?pr='%0A%0Aif (args.url):%0A    if args.url.startswith('http'):%0A        request_url = args.url+curl_uri%0A    else:%0A        request_url = 'http://'+args.url+curl_uri%0Aelse:%0A    print 'We need an URL'%0A    exit(1)%0A%0Aif (args.pr):%0A    pull_requests = args.pr.split()%0A    pull_requests = %22,%22.join(pull_requests)%0Aelse:%0A    print 'A list of PRs is needed'%0A    exit(1)%0A%0Atry:%0A    r = requests.get(request_url+pull_requests)%0Aexcept:%0A    print 'Something went wrong querying Monorail'%0A    exit(2)%0A%0Ajson_list = r.json()%0Aservices=json_list%5B'services'%5D%0Adeploynotes=json_list%5B'deployNotes'%5D%0A%0Aif deploynotes == 'True':%0A    print 'There are deployNotes so we cannot continue'%0A    exit(3)%0A%0Aif len(services) == 0:%0A    print 'There are not services defined so we cannot continue'%0A    exit(4)%0A%0Aexit (0)%0A

Add script that gets the services and deployNotes where a list of Pull requests will be deployed