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>