Exceptions raised if UA_CONFIG_FILE is bad
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
In Progress
|
Undecided
|
Grant Orndorff |
Bug Description
The documentation[1] says that current_news and updates() raise no exceptions, but:
--->
% UA_CONFIG_FILE=/ python3 -c "from uaclient.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/
return _updates(
File "/usr/lib/
self.cfg, self.invalid_keys = parse_config(
File "/usr/lib/
cfg.
File "/usr/lib/
with open(filename, "rb") as stream:
<---
[1] https:/
Hello Nathan, thanks for raising this issue.
tl;dr yes docs are wrong.
The thing it should express is that this endpoint raises no *specific* exceptions, but at any time unexpected exceptions may happen and will be raised as UbuntuProError instances.
There is ongoing work to update this on the docs as part of [1]. More specifically, there will be a message like [2] for all endpoints, which reflects the truth.
[1] https:/ /github. com/canonical/ ubuntu- pro-client/ pull/3085
[2] https:/ /github. com/canonical/ ubuntu- pro-client/ pull/3085/ files#diff- e0d846a2fce3599 317d4f913c5c925 7ec46228952bfc3 a16b8bb7e807416 0a99R102- R109