/usr/lib/ubuntu-advantage/apt_news.py:KeyError:/usr/lib/ubuntu-advantage/apt_news.py@32:main:update_apt_news:local_apt_news:get_contract_expiry_status:contract_remaining_days:contract_expiry_datetime
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
Undecided
|
Grant Orndorff | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Kinetic |
Fix Released
|
Undecided
|
Unassigned | ||
Lunar |
Fix Released
|
Undecided
|
Grant Orndorff |
Bug Description
[Original Description]
The Ubuntu Error Tracker has been receiving reports about a problem regarding ubuntu-
If you do not have access to the Ubuntu Error Tracker and are a software developer, you can request it at http://
[Impact]
When running the apt_news job, the job will fail if the contract does not have an effective date. Users will see a degraded status for the systemctl job.
[Test Case]
To test this fix we will add an integration test that target the scenario where we have null effectiveTo date and verify that the apt_news job does not fail and correctly show the expired message when running the `apt upgrade` command.
[Regression Potential]
This change is just making the code more resilient to null values for effective dates. Since the apt_news feature was broken on that scenario, we don't believe the fix should provide any major regression here.
[Discussion]
We are now assuming that the contract is expired if it does not have a valid effective date. This will allow us to correctly message the user and alert that the subscription need to be renewed.
Related branches
- Sergio Durigan Junior (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 1426 lines (+827/-88)32 files modifiedapt-hook/json-hook.cc (+11/-6)
apt-hook/json-hook.hh (+2/-0)
debian/changelog (+26/-0)
debian/ubuntu-advantage-tools.postinst (+20/-2)
docs/explanations/apt_messages.md (+2/-2)
features/apt_messages.feature (+26/-1)
features/attached_status.feature (+22/-1)
features/motd_messages.feature (+27/-4)
features/security_status.feature (+2/-1)
features/steps/network.py (+1/-15)
features/ubuntu_pro.feature (+0/-3)
features/unattached_commands.feature (+1/-1)
lib/esm_cache.py (+7/-1)
lib/timer.py (+14/-1)
sru/release-27.13.3/test-conffile-temp-fix.sh (+222/-0)
sru/release-27.13.4/test-no-esm-apps-duplicates-attached.sh (+103/-0)
sru/release-27.13.4/test-no-esm-apps-duplicates.sh (+109/-0)
uaclient/apt_news.py (+6/-4)
uaclient/exceptions.py (+14/-0)
uaclient/files/files.py (+10/-6)
uaclient/jobs/update_messaging.py (+14/-4)
uaclient/messages.py (+14/-0)
uaclient/security.py (+9/-6)
uaclient/security_status.py (+1/-1)
uaclient/status.py (+3/-1)
uaclient/system.py (+24/-17)
uaclient/tests/test_esm_cache.py (+25/-1)
uaclient/tests/test_security.py (+2/-2)
uaclient/tests/test_security_status.py (+13/-0)
uaclient/tests/test_system.py (+55/-7)
uaclient/tests/test_ua_timer.py (+41/-0)
uaclient/version.py (+1/-1)
description: | updated |
This is slightly different to 2004535 and 2004650 and will be closed individually.
Grant has a PR up and the next hot-fix will address this.