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

Side by Side Diff: appengine/components/tools/gae.py

Issue 2987613002: Fix gae.py's detection of current active credentials. (Closed)
Patch Set: typo Created 3 years, 5 months 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 | « appengine/components/tool_support/gae_sdk_utils.py ('k') | no next file » | 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/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The LUCI Authors. All rights reserved. 2 # Copyright 2014 The LUCI Authors. All rights reserved.
3 # Use of this source code is governed under the Apache License, Version 2.0 3 # Use of this source code is governed under the Apache License, Version 2.0
4 # that can be found in the LICENSE file. 4 # that can be found in the LICENSE file.
5 5
6 """Wrapper around GAE SDK tools to simplify working with multi module apps.""" 6 """Wrapper around GAE SDK tools to simplify working with multi module apps."""
7 7
8 __version__ = '1.2' 8 __version__ = '1.2'
9 9
10 import atexit 10 import atexit
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 app.app_dir, 'origin/master') 65 app.app_dir, 'origin/master')
66 logs, _ = log_since.get_logs( 66 logs, _ = log_since.get_logs(
67 app.app_dir, pseudo_revision, mergebase, start, end) 67 app.app_dir, pseudo_revision, mergebase, start, end)
68 print('\nLogs between %s and %s:' % (from_version, to_version)) 68 print('\nLogs between %s and %s:' % (from_version, to_version))
69 print('%s\n' % logs) 69 print('%s\n' % logs)
70 70
71 71
72 ## 72 ##
73 73
74 74
75 def CMDappcfg_login(parser, args):
76 """Sets up authentication for appcfg.py usage [DEPRECATED]."""
77 app, _, _ = parser.parse_args(args)
78 print (
79 'Since appcfg.py doesn\'t support explicit login command, we\'ll run '
80 'innocent "list_version" instead. It will trigger appcfg\'s login flow. '
81 '\n'
82 'It\'s fine if "list_version" call itself fails - at this point we have '
83 'the necessary credentials cached and other subcommands should be able '
84 'to use them.\n')
85 gae_sdk_utils.appcfg_login(app)
86 return 0
87
88
75 def CMDactive(parser, args): 89 def CMDactive(parser, args):
76 """Prints the active versions on the server. 90 """Prints the active versions on the server.
77 91
78 This is an approximation of querying which version is the default. 92 This is an approximation of querying which version is the default.
79 """ 93 """
80 parser.add_option( 94 parser.add_option(
81 '-b', '--bare', action='store_true', 95 '-b', '--bare', action='store_true',
82 help='Only print the version(s), nothing else') 96 help='Only print the version(s), nothing else')
83 app, options, _modules = parser.parse_args(args) 97 app, options, _modules = parser.parse_args(args)
84 data = app.get_actives() 98 data = app.get_actives()
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 print >> sys.stderr, str(e) 520 print >> sys.stderr, str(e)
507 return 1 521 return 1
508 except KeyboardInterrupt: 522 except KeyboardInterrupt:
509 # Don't dump stack traces on Ctrl+C, it's expected flow in some commands. 523 # Don't dump stack traces on Ctrl+C, it's expected flow in some commands.
510 print >> sys.stderr, '\nInterrupted' 524 print >> sys.stderr, '\nInterrupted'
511 return 1 525 return 1
512 526
513 527
514 if __name__ == '__main__': 528 if __name__ == '__main__':
515 sys.exit(main(sys.argv[1:])) 529 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « appengine/components/tool_support/gae_sdk_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698