-
Notifications
You must be signed in to change notification settings - Fork 294
Error reported when plugin catalog is empty #1229
Comments
If the reporting is changed to not be an error, what do you think the snapctl behavior should be? I think right now it would end up printing out the column header info then nothing which is not ideal. |
Yeah, this is not an error. Asking for a list of metrics should be able to return an empty list. |
This is definitely a change in behavior with the merge of PR #1220. Prior to this PR, an empty list would be returned to snapctl, and snapctl would just print out the column headers. |
Functionally a REST API call to a list can return an empty list without error. Snapctl can be a bigger discussion. I would prefer maybe a "helper" message after the empty list that can say "Try loading a plugin first to get some metrics" |
Empty metric catalog no longer logs or returns an error when queried via the rest API (or any other method). Will instead return an empty list of metrics, leaving choice of how to display that to the caller. Removes the empty metric catalog error and modifies client_func_test to reflect the changes in behavior.
I submitted a PR for this and opened #1233 to track improvements to snapctl dealing with empty lists for metrics/plugins. |
Fixes #1229: Empty metric catalog no longer errors
Empty metric catalog no longer logs or returns an error when queried via the rest API (or any other method). Will instead return an empty list of metrics, leaving choice of how to display that to the caller. Removes the empty metric catalog error and modifies client_func_test to reflect the changes in behavior.
Reproduction steps:
snapd
eg.snapd -t 0 -l 1&
snapctl metric list
Results:
Snapctl reports error
Snapd reports error
This should not be reported as error, maybe just info, or warning?
During large tests
pytest
module checks snap output for any error, and fails the test if any error was found. While this could be easily changed to omit/discard errors returned by snapd, I think it's not beneficial to large tests in generalThe text was updated successfully, but these errors were encountered: