distcloud-client/distributedcloud-client/dcmanagerclient
Salman Rana db6d32fdf7 Fix deploy upload invalid arg exit
Raise a DCManagerClientException to exit from the deploy
upload command handler when an invalid
file arg is encountered. Otherwise, exiting the method
with a simple return results in:
 - an exit code of 0 (a non-zero exit code is expected)
 - Output of an empty deploy table
   (SubcloudDeployUpload is a subclass of DCManagerShowOne.
   A simple return is interpreted as success, hence a console
   output of an empty result is displayed)

Overall, this behavior is misleading as it indicates success
despite the failure. This behavior is specific to the file arg
check (client-side validation done prior to the endpoint call).
Backend errors have been verified to be handled properly,
with a non-zero exit code.

Test Plan:
Using deploy upload (dcmanager subcloud-deploy upload):
  1. PASS: Execute the command with valid
     arguments (correct file references); verify a zero exit code
     (“echo $?”) and console output displaying the
     deploy table.
  2. PASS: Execute the command with an invalid argument
     (missing reference file); verify a non-zero exit code
     (“echo $?”), no deploy table console output and an
     error message “ERROR (app) <arg> does not exist: <file>”

Closes-Bug: 2032970

Change-Id: I53da00a1ba4562aae4345ea1182ca923d227d0e8
Signed-off-by: Salman Rana <salman.rana@windriver.com>
2023-08-30 17:56:58 +00:00
..
api Merge "Add system peer management API support" 2023-08-28 13:23:59 +00:00
commands Fix deploy upload invalid arg exit 2023-08-30 17:56:58 +00:00
osc Add debian package for distributedcloud-client 2022-01-24 03:40:20 -03:00
tests Fix deploy upload invalid arg exit 2023-08-30 17:56:58 +00:00
__init__.py Remove WR License notice from StarlingX distributed cloud client 2021-12-22 13:23:29 -05:00
exceptions.py Remove WR License notice from StarlingX distributed cloud client 2021-12-22 13:23:29 -05:00
shell.py Merge "Add system peer management API support" 2023-08-28 13:23:59 +00:00
utils.py Merge "Add system peer management API support" 2023-08-28 13:23:59 +00:00