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

"mc-agent cli -c list" should not return exit code 0 on error #17

Open
asashnov opened this issue Dec 18, 2018 · 1 comment
Open

"mc-agent cli -c list" should not return exit code 0 on error #17

asashnov opened this issue Dec 18, 2018 · 1 comment

Comments

@asashnov
Copy link
Contributor

"mc-agent cli -c list" should not return exit code 0 on error

Currently mc-agent cli -c list always returns exit code 0, even there is some error, so Mooltipass GUI, SSH Keys tab can't distinct empty list of keys from any error occured.

Actual result:

$ mc-agent cli -c list
[]
$ echo $?
0

Now exit code is always 0 no matter what:

  • Mooltipass device is not connected
  • Security card is not inserted
  • Mooltipass is locked
  • Getting "moolticute ssh keys" wasn't confirmed

Expected result:

Exit code should be non-zero in a case of any error.
Moolticute GUI, "SSH Keys" tab should show an error if SSH Keys was not loaded from a device.

Only absence of "moolticute ssh keys" file is a normal situation and exit code should be 0
if there is no such file on a Mooltipass device (mc-agent wasn't used yet).

@oliverpool
Copy link

I did some testing (with a Mini BLE), and apparently only the last case Getting "moolticute ssh keys" wasn't confirmed is indistinguishable from the missing file.

The other cases send a mp_disconnected or status_changed message and could be better handled to return some other exit code (I have a prototype here: https://git.sr.ht/~oliverpool/go-moolticute/tree/main/item/client.go)

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

2 participants