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

gwcli return code is always 0 when invocation includes a command to run #232

Open
anmayes opened this issue Mar 10, 2021 · 0 comments
Open

Comments

@anmayes
Copy link

anmayes commented Mar 10, 2021

A non-zero sys.exit should be reported when a command fails.

Command below should fail and report the rbd image already exists.

# gwcli /disks/ create pool=rbd image=iscsi-test-image size=100G
# echo $?
0
#
2021-03-10 21:37:14,373 DEBUG    [ceph.py:33:__init__()] Adding ceph cluster 'ceph' to the UI
2021-03-10 21:37:14,711 DEBUG    [ceph.py:241:populate()] Fetching ceph osd information
2021-03-10 21:37:14,783 DEBUG    [ceph.py:150:update_state()] Querying ceph for state information
2021-03-10 21:37:14,994 DEBUG    [storage.py:105:refresh()] Refreshing disk information from the config object
2021-03-10 21:37:14,994 DEBUG    [storage.py:109:refresh()] - Scanning will use 8 scan threads
2021-03-10 21:37:15,121 DEBUG    [storage.py:135:refresh()] - rbd image scan complete: 1s
2021-03-10 21:37:15,123 DEBUG    [gateway.py:378:refresh()] Refreshing gateway & client information
2021-03-10 21:37:15,431 DEBUG    [gateway.py:935:refresh()] - checking iSCSI/API ports on esg4bel40.mastercard.int
2021-03-10 21:37:15,699 DEBUG    [gateway.py:935:refresh()] - checking iSCSI/API ports on esg4bel38.mastercard.int
2021-03-10 21:37:16,245 DEBUG    [ceph.py:150:update_state()] Querying ceph for state information
2021-03-10 21:37:16,308 DEBUG    [ceph.py:261:refresh()] Gathering pool stats for cluster 'ceph'
2021-03-10 21:37:16,364 DEBUG    [storage.py:262:ui_command_create()] CMD: /disks/ create pool=rbd image=iscsi-test-image size=100G count=1
2021-03-10 21:37:16,365 DEBUG    [storage.py:281:_valid_pool()] pool 'rbd' is ok to use
2021-03-10 21:37:16,365 DEBUG    [storage.py:304:create_disk()] Creating/mapping disk rbd/iscsi-test-image
2021-03-10 21:37:16,365 DEBUG    [storage.py:317:create_disk()] Issuing disk create request
2021-03-10 21:37:16,522 ERROR    [storage.py:369:create_disk()] Failed : at least one rbd image(s) with that name/prefix is already defined

For reference:

sys.exit(0)

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

No branches or pull requests

1 participant