Return error_code in command "job binary download"
return an error code if download file exists. Change-Id: Ia7a21fb9f34ada1938eb169cc5ba2725d75874d7
This commit is contained in:
parent
7ede456acb
commit
214e2603de
|
@ -419,8 +419,9 @@ class DownloadJobBinary(command.Command):
|
|||
data = client.job_binaries.get_file(jb_id)
|
||||
|
||||
if path.exists(parsed_args.file):
|
||||
self.log.error('File "%s" already exists. Chose another one with '
|
||||
'--file argument.' % parsed_args.file)
|
||||
msg = ('File "%s" already exists. Chose another one with '
|
||||
'--file argument.' % parsed_args.file)
|
||||
raise exceptions.CommandError(msg)
|
||||
else:
|
||||
with open(parsed_args.file, 'w') as f:
|
||||
f.write(data)
|
||||
|
|
Loading…
Reference in New Issue