image_upload: allow ctrl-c

Allow operators to run ctrl-c during image uplaod and gracefully exit.

Change-Id: I6e4aead3e4a03d1025b987bc2f0305614e4d0c18
Closes-Bug: #1746724
This commit is contained in:
Emilien Macchi 2018-02-07 06:04:07 -08:00
parent 12ffd71970
commit e72065cd33
1 changed files with 4 additions and 1 deletions

View File

@ -61,7 +61,10 @@ class UploadImage(command.Command):
self.log.debug("take_action(%s)" % parsed_args)
uploader = image_uploader.ImageUploadManager(
parsed_args.config_files)
uploader.upload()
try:
uploader.upload()
except KeyboardInterrupt: # ctrl-c
self.log.warning('Upload was interrupted by ctrl-c.')
class BuildImage(command.Command):