Fix software upload error message
The return message in case of the iso or sig file doesn't exist was also returning "cannot unpack non-iterable int object". This commit fix this behavior. Test Plan: PASS: Software upload with non-existent files. PASS: Software upload successfully. Story: 2010676 Task: 51023 Change-Id: I8d487eee10d1471344ea3644d438c93bd880aa6c Signed-off-by: Luis Eduardo Bonatti <luizeduardo.bonatti@windriver.com>
This commit is contained in:
@@ -63,7 +63,6 @@ class ReleaseManager(base.Manager):
|
||||
return self._fetch(path)
|
||||
|
||||
def upload(self, args):
|
||||
rc = 0
|
||||
|
||||
# arg.release is a list
|
||||
releases = args.release
|
||||
@@ -92,7 +91,7 @@ class ReleaseManager(base.Manager):
|
||||
|
||||
if len(valid_files) == 0:
|
||||
print("No file to be uploaded.")
|
||||
return rc
|
||||
return 1
|
||||
|
||||
path = '/v1/release'
|
||||
if is_local:
|
||||
|
@@ -191,7 +191,11 @@ def _print_upload_result(resp, data, debug):
|
||||
action='store_true')
|
||||
def do_upload(cc, args):
|
||||
"""Upload a software release"""
|
||||
resp, data = cc.release.upload(args)
|
||||
result = cc.release.upload(args)
|
||||
if isinstance(result, int):
|
||||
return result
|
||||
else:
|
||||
resp, data = result[0], result[1]
|
||||
_print_upload_result(resp, data, args.debug)
|
||||
|
||||
return utils.check_rc(resp, data)
|
||||
|
Reference in New Issue
Block a user