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

Handle missing device more gracefully #179

Open
coldfix opened this issue May 3, 2019 · 1 comment
Open

Handle missing device more gracefully #179

coldfix opened this issue May 3, 2019 · 1 comment

Comments

@coldfix
Copy link
Owner

coldfix commented May 3, 2019

Calling udiskie-info with an invalid device (and other valid ones), no info is printed and an exception traceback is shown instead:

However, it breaks when when searching for /dev/loop

myuser@mycomputer:~$ udiskie-info -o 'id_type' /dev/loop*
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/udiskie/cli.py", line 289, in _start_async_tasks
    results = yield self._init()
  File "/usr/lib/python3/dist-packages/udiskie/cli.py", line 724, in _init
    devices = [self.udisks.find(path) for path in options['<device>']]
  File "/usr/lib/python3/dist-packages/udiskie/cli.py", line 724, in <listcomp>
    devices = [self.udisks.find(path) for path in options['<device>']]
  File "/usr/lib/python3/dist-packages/udiskie/udisks2.py", line 584, in find
    raise ValueError(_('no device found owning "{0}"', path))
ValueError: master device was not found for "/dev/loop-control"

Originally posted by @mixpc in #177 (comment)

This should be handled more gracefully, show a "invalid device: {...}" message on stderr, but print the rest of the information nevertheless.

Opening this here as separate issue so I don't forget about it.

@hohol92
Copy link

hohol92 commented Mar 23, 2021

I think this is not a problem

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