Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: infra/tools/cros_pin/__main__.py

Issue 1403313002: Added `cros_pin` CrOS pin-bump tool. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Added pinfile.py tests, cleanup. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « infra/tools/cros_pin/__init__.py ('k') | infra/tools/cros_pin/checkout.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright 2014 Google Inc. All Rights Reserved. 2 # Copyright 2014 Google Inc. All Rights Reserved.
3 # pylint: disable=F0401 3 # pylint: disable=F0401
4 4
5 """Restart a master via master-manager.""" 5 """CrOS pin management/update tool."""
6 6
7 7
8 import argparse 8 import argparse
9 import datetime 9 import datetime
10 import sys 10 import sys
11 11
12
13 import infra_libs.logs 12 import infra_libs.logs
14 13
15 14 from infra.tools.cros_pin import cros_pin
16 from infra.tools.restart import restart
17 15
18 16
19 def main(argv): 17 def main(argv):
20 parser = argparse.ArgumentParser( 18 parser = argparse.ArgumentParser(
21 prog='restart', 19 prog='cros-pin',
22 description=sys.modules['__main__'].__doc__) 20 description=sys.modules['__main__'].__doc__)
23 infra_libs.logs.add_argparse_options(parser) 21 infra_libs.logs.add_argparse_options(parser)
24 restart.add_argparse_options(parser) 22 cros_pin.add_argparse_options(parser)
23
25 args = parser.parse_args(argv) 24 args = parser.parse_args(argv)
26 infra_libs.logs.process_argparse_options(args) 25 infra_libs.logs.process_argparse_options(args)
27 26
28 if args.minutes_in_future < 0: 27 # Execute our subcommand (configured by cros_pin.add_argparse_options).
29 parser.error('minutes-in-future must be nonnegative, use 0 for "now"') 28 return args.func(args)
30
31 delta = datetime.timedelta(minutes=args.minutes_in_future)
32
33 return restart.run(args.masters, delta, args.reviewer, args.bug, args.force,
34 args.no_commit)
35 29
36 30
37 if __name__ == '__main__': 31 if __name__ == '__main__':
38 sys.exit(main(sys.argv[1:])) 32 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « infra/tools/cros_pin/__init__.py ('k') | infra/tools/cros_pin/checkout.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698