Merge ~chad.smith/software-properties:ua-status-from-json-impish into software-properties:ubuntu/impish

Proposed by Chad Smith
Status: Merged
Merged at revision: def98e83b50cfb9be2354d0680a5f654ce043855
Proposed branch: ~chad.smith/software-properties:ua-status-from-json-impish
Merge into: software-properties:ubuntu/impish
Diff against target: 17 lines (+4/-1)
1 file modified
softwareproperties/gtk/SoftwarePropertiesGtk.py (+4/-1)
Reviewer Review Type Date Requested Status
Robert Ancell (community) Approve
Review via email: mp+411102@code.launchpad.net

Commit message

SoftwarePropertiesGTK: ignore timezone offsets of contract expiry

Avoid 'Unable to process contract expiry' messages

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/softwareproperties/gtk/SoftwarePropertiesGtk.py b/softwareproperties/gtk/SoftwarePropertiesGtk.py
index e77e179..f7ccc93 100644
--- a/softwareproperties/gtk/SoftwarePropertiesGtk.py
+++ b/softwareproperties/gtk/SoftwarePropertiesGtk.py
@@ -426,8 +426,11 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
426 # gives software properties dialogs a chance to interact about426 # gives software properties dialogs a chance to interact about
427 # renewals if needed.427 # renewals if needed.
428 try:428 try:
429 # Ignore timezone to simplify formatting python < 3.7
430 # 3.7 has datetime.fromisoformat()
431 dt, _sep, _tz = status.get("expires", "").partition("+")
429 eol_date = datetime.datetime.strptime(432 eol_date = datetime.datetime.strptime(
430 status.get("expires"), "%Y-%m-%dT%H:%M:%S"433 dt, "%Y-%m-%dT%H:%M:%S"
431 ).date()434 ).date()
432 except ValueError:435 except ValueError:
433 print("Unable to determine UA contract expiry")436 print("Unable to determine UA contract expiry")

Subscribers

People subscribed via source and target branches