Comment 26 for bug 1920836

Revision history for this message
Chad Smith (chad.smith) wrote :

>> Is there a reason why the ua client doesn't do this itself internally, i.e. it gives you fresh json or returns the cached copy if it can't do the update?

Currently the only "time" during which ubuntu-advantage-tools (UA client) could perform the logic to exec 'sudo ua status' is during postinst at package install upgrade time. UA client can not perform that status setup during package install for the same timeout reasons you mentioned. It is a potentially long operation. If run during a package install it could delay or prevent other package upgrades if it hits a timeout and/or error. That said, we are working on instrumenting a systemd timer service that can run config change/setup operations out of band of typical APT package installs. So, this case could be handled by that timer-based service. This SRU does represent.

This changeset as-is does represent an improvement to existing cases because the Software properties UX demonstrates awareness of ESM (and contract expiry information) properly for attached machines, or unattached machines where `sudo ua status` has been run.

Subsequent releases of software-properties will now be able to take advantage of reading "ua status --format=json" output directly as non-root (due to a bug-fix released in 27.2.1). The non-root user will not have to rely anymore on that json file if absent as the --format=json output will render the same JSON dict that would be present on disk for the root user. This is a fix that is under verification in the -proposed queue now for ua-tools and was not available at the time of this original software-properties PR. I'm ok with this approach as-is knowing that we can significantly improve the behavior once ubuntu-advantage-tools 27.2.1 is released to X B F and H