| Index: scripts/slave/recipe_modules/crrev/resources/crrev_client.py
|
| diff --git a/scripts/slave/recipe_modules/crrev/resources/crrev_client.py b/scripts/slave/recipe_modules/crrev/resources/crrev_client.py
|
| index 9987fc7bebc99c7aca0ee1fe6c7b6991c60a038a..424bef78e9bbbddb61c3c1b10d03b2836b6acf8e 100755
|
| --- a/scripts/slave/recipe_modules/crrev/resources/crrev_client.py
|
| +++ b/scripts/slave/recipe_modules/crrev/resources/crrev_client.py
|
| @@ -61,17 +61,17 @@ def crrev_get(path, params, attempts):
|
| retry_delay_seconds *= 2
|
|
|
|
|
| -def main():
|
| +def main(args):
|
| parser = argparse.ArgumentParser()
|
| parser.add_argument('path', help='Path + query to add onto the base URL.')
|
| parser.add_argument('--params-file', help='Request parameter JSON file.')
|
| parser.add_argument('--attempts', default=1, help='Number of times to retry.')
|
| - args = parser.parse_args()
|
| + args = parser.parse_args(args)
|
| params = {}
|
| if args.params_file:
|
| - params = json.lad(args.params_file)
|
| - print json.dumps(crrev_get(args.path, params, args.attempts), indent=2)
|
| + params = json.load(open(args.params_file))
|
| + return json.dumps(crrev_get(args.path, params, args.attempts), indent=2)
|
|
|
|
|
| if __name__ == '__main__':
|
| - main()
|
| + print main(sys.argv[1:])
|
|
|