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

Reverse the exitcode initialization value #198

Closed
wants to merge 1 commit into from

Conversation

gportay
Copy link

@gportay gportay commented Feb 7, 2020

Fakemachine is subject to panic and causes Debos to exit success due to
the current logic of the exitcode. For example, the fakemachine function
CopyFileTo() panics if the file is missing.

In the case of a panic, the function never returns. Thus, the exitcode
cannot be set to 1 and Debos exits with 0.

This commit reverses the logic of the exitcode: it is initialized to 1
(i.e. failure), and it is set to 0 (i.e. success) only if Debos has
reached the end of the things it has to do (or for the help message).

Signed-off-by: Gaël PORTAY [email protected]

Fakemachine is subject to panic and causes Debos to exit success due to
the current logic of the exitcode. For example, the fakemachine function
CopyFileTo() panics if the file is missing.

In the case of a panic, the function never returns. Thus, the exitcode
cannot be set to 1 and Debos exits with 0.

This commit reverses the logic of the exitcode: it is initialized to 1
(i.e. failure), and it is set to 0 (i.e. success) only if Debos has
reached the end of the things it has to do (or for the help message).

Signed-off-by: Gaël PORTAY <[email protected]>
@sjoerdsimons
Copy link
Member

The code makes sense to me; would need some testing of the various failure and test cases and with both kvm and non-fakemachine runs

@gportay
Copy link
Author

gportay commented Aug 4, 2020

The code makes sense to me; would need some testing of the various failure and test cases and with both kvm and non-fakemachine runs

@sjoerdsimons: I can do some testing if needed. Just tell me how to test it.

@obbardc
Copy link
Member

obbardc commented Aug 13, 2021

superseded by #278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants