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

Side by Side Diff: third_party/gsutil/gslib/commands/config.py

Issue 341833005: Fix undefined default_config_path_bak in gsutil config. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 # Copyright 2011 Google Inc. All Rights Reserved. 1 # Copyright 2011 Google Inc. All Rights Reserved.
2 # 2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); 3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License. 4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at 5 # You may obtain a copy of the License at
6 # 6 #
7 # http://www.apache.org/licenses/LICENSE-2.0 7 # http://www.apache.org/licenses/LICENSE-2.0
8 # 8 #
9 # Unless required by applicable law or agreed to in writing, software 9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, 10 # distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 try: 618 try:
619 sys.stderr.write( 619 sys.stderr.write(
620 'Backing up existing config file "%s" to "%s"...\n' 620 'Backing up existing config file "%s" to "%s"...\n'
621 % (default_config_path, default_config_path_bak)) 621 % (default_config_path, default_config_path_bak))
622 os.rename(default_config_path, default_config_path_bak) 622 os.rename(default_config_path, default_config_path_bak)
623 except e: 623 except e:
624 raise CommandException('Failed to back up existing config ' 624 raise CommandException('Failed to back up existing config '
625 'file ("%s" -> "%s"): %s.' 625 'file ("%s" -> "%s"): %s.'
626 % (default_config_path, default_config_path_bak, e)) 626 % (default_config_path, default_config_path_bak, e))
627 output_file_name = default_config_path 627 output_file_name = default_config_path
628 else:
629 default_config_path_bak = None
Ryan Tseng 2014/06/23 21:29:22 Move this before 597 before the if (to make it mor
628 630
629 if output_file_name == '-': 631 if output_file_name == '-':
630 output_file = sys.stdout 632 output_file = sys.stdout
631 else: 633 else:
632 output_file = self._OpenConfigFile(output_file_name) 634 output_file = self._OpenConfigFile(output_file_name)
633 635
634 # Catch ^C so we can restore the backup. 636 # Catch ^C so we can restore the backup.
635 signal.signal(signal.SIGINT, cleanup_handler) 637 signal.signal(signal.SIGINT, cleanup_handler)
636 try: 638 try:
637 self._WriteBotoConfigFile(output_file, use_oauth2=use_oauth2, 639 self._WriteBotoConfigFile(output_file, use_oauth2=use_oauth2,
(...skipping 15 matching lines...) Expand all
653 655
654 if output_file_name != '-': 656 if output_file_name != '-':
655 output_file.close() 657 output_file.close()
656 sys.stderr.write( 658 sys.stderr.write(
657 '\nBoto config file "%s" created.\n' % output_file_name) 659 '\nBoto config file "%s" created.\n' % output_file_name)
658 660
659 return 0 661 return 0
660 662
661 def cleanup_handler(signalnum, handler): 663 def cleanup_handler(signalnum, handler):
662 raise AbortException('User interrupted config command') 664 raise AbortException('User interrupted config command')
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698