OpenSCAP / openscap-daemon

Manages continuous scans of your infrastructure
https://www.open-scap.org/tools/openscap-daemon
GNU Lesser General Public License v2.1
106 stars 32 forks source link

oscapd-cli traceback without any arguments #79

Closed jan-cerny closed 8 years ago

jan-cerny commented 8 years ago

Hello, I use openscap-daemon-0.1.4-1.fc23.noarch from Fedora 23 updates testing repository. and I have seen a traceback when I omitted -i option:

[root@thinkpad jcerny]# oscapd-cli task-create
Traceback (most recent call last):
  File "/usr/bin/oscapd-cli", line 787, in <module>
    main()
  File "/usr/bin/oscapd-cli", line 775, in main
    cli_task_create(dbus_iface, args)
  File "/usr/bin/oscapd-cli", line 386, in cli_task_create
    raise NotImplementedError("Not yet!")
NotImplementedError: Not yet!
ybznek commented 8 years ago

I suggest to close this issue. https://github.com/OpenSCAP/openscap-daemon/issues/3

Now it really says what is wrong "NotImplementedError: Not yet!" and traceback is bonus. :+1:

jan-cerny commented 8 years ago

I see, but I am not much happy when I get such a "bonus" :-)

mpreisler commented 8 years ago

It is not implemented so this is really a feature request, not a bug...

jan-cerny commented 8 years ago

Ok, I only thought that it is not nice to show tracebacks to users. In my opinion it would be better to catch this exception and show an error message.

mpreisler commented 8 years ago

I am a fan of tracebacks, they are very useful. I don't find them offensive or embarrassing. Perhaps that's just me though.

jan-cerny commented 8 years ago

@mpreisler I also like when an bug report contains a traceback, it is definitely helpful for me.

But in my opinion tracebacks that have already been reported should be handled or fixed. It is quite easy to do it in Python. I think that a traceback should appear only when something went wrong that we don't know about yet.

In this particular case, the expected behavior is to tell the user that he must specify more options to do some action, give him an advice which options are possible and terminate. The fact that some RFE is not implemented now doesn't necessarily conflict with this expectation.

I would like to point out that the goal of oscapd-cli is easy and simple user interaction. I don't know whether a traceback is a recommended way of communication with users.

There exist users who don't understand details of our implementation so when they will see this particular traceback they will think that something horrible happened or they are missing some package etc. We will have to spend time explaining that.

jan-cerny commented 8 years ago

Fixed in https://github.com/OpenSCAP/openscap-daemon/pull/87