Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cli command should return valid exit_code. #163

Open
abhijeetkaurav1st opened this issue Mar 26, 2021 · 1 comment
Open

Cli command should return valid exit_code. #163

abhijeetkaurav1st opened this issue Mar 26, 2021 · 1 comment
Labels
P1 Critical

Comments

@abhijeetkaurav1st
Copy link
Collaborator

calm create bp command return a zero exit code even though it results in an Error. Calm command should return an exit code other than zero on error.

Use-case: within a CI/CD pipeline, the exit code is resulting is false job completion status.

@abhijeetkaurav1st abhijeetkaurav1st added the P1 Critical label Mar 26, 2021
@bchristianv
Copy link

Just to add some context, this particular issue was the result of basic_cred() username not being set correctly which resulted in spec.resources.credential_definition_list.0.username being None in the json. The Calm server reported the error but the calm dsl command returned 0 exit code.

[ERROR] [calm.dsl.cli.bp_commands:191] {'api_version': '3.1', 'code': 422, 'message_list': [{'details': {'spec.resources.credential_definition_list.0.username': ["None is not of type 'string'"]}, 'message': 'Request could not be processed.', 'reason': 'INVALID_REQUEST'}], 'state': 'ERROR'}
[2021-03-24 00:50:47] [DEBUG] [calm.dsl.db.handler:71] Closing connection to local DB
$ echo $?
0

I've seen other errors result in 1 exit code by the calm command, it just did not happen in this case as I would have expected.

abhijeetkaurav1st added a commit that referenced this issue Aug 23, 2022
* Ignore ther accounts for non-ahv clusters

* black formatting

(cherry picked from commit 436f5b5d2f08e665659bcb25fc1984d2168ffddc)
abhijeetkaurav1st added a commit that referenced this issue Aug 25, 2022
* Ignore ther accounts for non-ahv clusters

* black formatting

(cherry picked from commit 436f5b5d2f08e665659bcb25fc1984d2168ffddc)
(cherry picked from commit d4eef0d)
abhijeetkaurav1st pushed a commit that referenced this issue Mar 9, 2023
* updated vpc project tests

* Updating filter for accounts API call to update VPC cache (#162)

Summary: Updating filter for accounts API call to update VPC cach

Test Plan: NA

Reviewers: abhijeet.kaura

Subscribers: nisarg.shah1

Bugs: #CALM-33047

Blame Revision: NA

Revert Plan: NA

Differential Revision: http://ph.eng.nutanix.com/D16603

* (#CALM-30585) Add support for custom roles in ACPs (#146)

(#CALM-30585) Add support for custom roles in ACPs

* Ignore the accounts for non-ahv clusters for cache update (#163)

* Ignore ther accounts for non-ahv clusters

* black formatting

* vpc-automation-changes

* make black changes

* black format

Co-authored-by: Yedhu Tilak P <[email protected]>
Co-authored-by: Abhijeet Singh Kaurav <[email protected]>
(cherry picked from commit 2fce6f7f1add4fac8844a1601381e99fb6f30cb4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Critical
Projects
None yet
Development

No branches or pull requests

2 participants