Merge ~orndorffgrant/ubuntu/+source/update-manager:tolerate-errors-from-pro-client-api into ubuntu/+source/update-manager:ubuntu/devel

Proposed by Grant Orndorff
Status: Merged
Merge reported by: Grant Orndorff
Merged at revision: 445e6c75b420ff903fd41b9a6d33d30ad1f0bc53
Proposed branch: ~orndorffgrant/ubuntu/+source/update-manager:tolerate-errors-from-pro-client-api
Merge into: ubuntu/+source/update-manager:ubuntu/devel
Diff against target: 36 lines (+12/-2)
2 files modified
UpdateManager/UpdateManager.py (+5/-2)
debian/changelog (+7/-0)
Reviewer Review Type Date Requested Status
Benjamin Drung (community) Approve
Julian Andres Klode (community) Approve
Robert Ancell Pending
Review via email: mp+440532@code.qastaging.launchpad.net

Description of the change

The ubuntu pro api function is erroring intermittently (#2015286 #2015113). That's a bug in pro-client - it shouldn't be making any network calls during this function. But it is unlikely to get fixed in time for lunar launch (the fix will hopefully go in as an SRU to lunar shortly after launch).

For now, we can catch any error the pro function might throw and proceed without displaying potential pro updates in that case.

I've also included a fix to use the correct field for the package name (See https://canonical-ubuntu-pro-client.readthedocs-hosted.com/en/latest/references/api.html#id74)

To post a comment you must log in.
Revision history for this message
Julian Andres Klode (juliank) wrote :

lgtm. I'd probably avoid setting the None and the if, and use try/except: pass/else instead but that's nitpicking and this works to.

Ship it!

review: Approve
Revision history for this message
Benjamin Drung (bdrung) :
Revision history for this message
Grant Orndorff (orndorffgrant) wrote :

Thanks for the reviews!

I adjusted the logic to avoid the None check as suggested. I also narrowed the errors we're catching. I'm still being cautious by catching some broad error categories, but you're right that catching Exception was too broad.

I've also added a changelog entry, lmk if I bumped the version incorrectly.

LMK what you think

Revision history for this message
Benjamin Drung (bdrung) wrote :

The change looks good. I am in the process of merging and releasing the change.

review: Approve
Revision history for this message
Benjamin Drung (bdrung) wrote :
Revision history for this message
Grant Orndorff (orndorffgrant) wrote :

Great - thank you!

Revision history for this message
Sebastien Bacher (seb128) wrote :

I don't have the needed right to change the status but could someone set it as merged?

Revision history for this message
Grant Orndorff (orndorffgrant) wrote :

Done! sorry about that

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches