Ultimately if we decide to go with #2 here's a patch that I think would
limit both the time cost of a remote uRL query and the noisy logging:


--- /usr/lib/python3/dist-packages/softwareproperties/gtk/utils.py      
2021-06-10 23:20:22.000000000 -0600
+++ /usr/lib/python3/dist-packages/softwareproperties/gtk/utils.py.new  
2021-07-14 15:19:14.485004311 -0600
@@ -76,23 +76,10 @@
 def get_ua_status():
     """Return a dict of all UA status information or empty dict on error."""
     # status.json will exist on any attached system or any unattached system
-    # which has already run `ua status`. Calling ua status directly on
-    # network disconnected machines will raise a TimeoutException trying to
-    # access contracts.canonical.com/v1/resources.
-    try:
-        # Success writes UA_STATUS_JSON
-        result = subprocess.run(['ua', 'status', '--format=json'], 
stdout=subprocess.PIPE)
-    except Exception as e:
-        print("Failed to call ubuntu advantage client:\n%s" % e)
-        return {}
-    if result.returncode != 0:
-        print("Ubuntu advantage client returned code %d" % result.returncode)
-        return {}
-
+    # which has already run `sudo ua status`.
     try:
         status_file = open(UA_STATUS_JSON, "r")
     except Exception as e:
-        print("No ua status file written:\n%s" % e)
         return {}
 
     with status_file as stream:

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1920836

Title:
  Show Extended Security Maintenence status

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/1920836/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to