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

Return values from openstack and other 3rd party commands #175

Open
4 tasks done
EGI-ILM opened this issue Nov 11, 2022 · 0 comments
Open
4 tasks done

Return values from openstack and other 3rd party commands #175

EGI-ILM opened this issue Nov 11, 2022 · 0 comments
Labels
enhancement New feature or request feature requests

Comments

@EGI-ILM
Copy link
Contributor

EGI-ILM commented Nov 11, 2022

Initial checklist

Problem

It will be useful to pass the return value of the openstack command into the shell, not only on text but as a value that can be directly queried by other scripts.

$ fedcloud openstack volume show test-volume2 --site ... --vo ...
Site: ..., command: volume show test-volume2
Error code:  1
Error message:  No volume with a name or ID of 'test-volume2' exists.

$ echo $?
0

This can apply to any other command that is called by fedcloudclient

Solution

Return the value / error code obtained from the openstack operation. In the example: 1.

Alternatives

Return an error code specific for fedcloud if the executed command fails.
For example, a code error of 100 + the error code returned by the command. In the example: 101.
This way it can be distinguished between specific fedcloudclient errors and 3rd party errors.

Note: 100 is just an example used for clarity, it could be 20 instead. Consider that there is a limited number of return codes that can be used (so the sum could be longer than this limit) and there are some reserved codes.

@tdviet tdviet added feature requests enhancement New feature or request labels Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature requests
Projects
None yet
Development

No branches or pull requests

2 participants