Merge ~chad.smith/software-properties:ua-status-from-json into software-properties:ubuntu/master
Status: | Merged |
---|---|
Merged at revision: | e2e7a5a9674f70961df8ccbc17961763de44e5f6 |
Proposed branch: | ~chad.smith/software-properties:ua-status-from-json |
Merge into: | software-properties:ubuntu/master |
Diff against target: |
141 lines (+57/-31) 2 files modified
debian/changelog (+9/-0) softwareproperties/gtk/utils.py (+48/-31) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Ancell (community) | Approve | ||
Grant Orndorff | Pending | ||
Lucas Albuquerque Medeiros de Moura | Pending | ||
Review via email: mp+411046@code.launchpad.net |
Commit message
utils: prefer ua status from status.json. Support schema 0.1 format
Adjust gtk.utils.
/var/lib/
ua status on the commandline due to a network roundtrip that
is performed while running the command.
This status.json file will exist on all machines attached to an
Ubuntu Advantage subscription.
Unattached machines will persist status.json due to a systemd timer
that will sync current unattached or attached status to
/var/lib/
Allow get_ua_status will now also check a _schema_version key from
ua status which will log if the schema version has changed from the
expected version "0.1".
Changes in schema version may imply incompatibility with reading
UA status.
Description of the change
bumped changelog version here. not sure if it's needed or not
Testing performed
1. launched desktop install of Jammy daily desktop images
2. confirmed failure path from LP: #1939732
jammy-desktop:~$ dpkg-query --show software- properties- gtk properties- gtk 0.99.13 properties- gtk ubuntu- advantage/ status. json' ubuntu- advantage/ status. json' ubuntu- advantage/ status. json'
software-
jammy-desktop:~$ software-
No ua status file written:
[Errno 2] No such file or directory: '/var/lib/
No ua status file written:
[Errno 2] No such file or directory: '/var/lib/
No ua status file written:
[Errno 2] No such file or directory: '/var/lib/
jammy-desktop:~$ sudo cp utils.py /usr/lib/ python3/ dist-packages/ softwarepropert ies/gtk/ utils.py
jammy-desktop:~$ dpkg-query --show software- properties- gtk
# no error on gtk dialog load on absent /var/lib/ ubuntu- advantage/ status. json ubuntu- advantage/ status. json ] && echo "status.json exists" properties- gtk
jammy-desktop:~$ [ -f /var/lib/
jammy-desktop:~$ software-
# click "Updates" table in dialog and see "Basic Security Maintenance"
# Attach to a subscription
jammy-desktop:~$ ua attach <mytoken>
jammy-desktop:~$ software- properties- gtk
# no errors
# click "Updates" table in dialog and see "Extended Security Maintenance" with an expiry from my contract: 12/31/1999
# no errors printed to console
# editing _schema_version to print informational messages on CLI version" : "0.1"/" _schema_ version" : "0.3"/' /var/lib/ ubuntu- advantage/ status. json properties- gtk
jammy-desktop:~$ sudo sed -i 's/"_schema_
jammy-desktop:~$ software-
UA status schema version change: 0.3