Merge ~nteodosio/update-manager:bionic-ua into update-manager:ubuntu/bionic

Proposed by Nathan Teodosio
Status: Merged
Approved by: Sebastien Bacher
Approved revision: d416ba3a2afb046ce55c06360cd28e4693b728b0
Merge reported by: Sebastien Bacher
Merged at revision: d416ba3a2afb046ce55c06360cd28e4693b728b0
Proposed branch: ~nteodosio/update-manager:bionic-ua
Merge into: update-manager:ubuntu/bionic
Diff against target: 228 lines (+67/-26)
4 files modified
UpdateManager/Core/UpdateList.py (+19/-6)
UpdateManager/UpdateManager.py (+9/-3)
UpdateManager/UpdatesAvailable.py (+32/-17)
debian/changelog (+7/-0)
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Review via email: mp+452904@code.launchpad.net

Description of the change

Couldn't test the PPA using the Ubuntu infrastructure: https://irclogs.ubuntu.com/2023/10/05/%23ubuntu-devel.html#t07:21.

Tested in a Bionic virtual machine, the tests get stuck in a later phase, but per experience with the other series, the linters are the firsts to run and those succeed, so it seems good to go:

--->
% LC_ALL=C xvfb-run nosetests3
...............................................................E.......................
<---

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/UpdateManager/Core/UpdateList.py b/UpdateManager/Core/UpdateList.py
2index 79c9bd8..1f16003 100644
3--- a/UpdateManager/Core/UpdateList.py
4+++ b/UpdateManager/Core/UpdateList.py
5@@ -425,7 +425,8 @@ class UpdateList():
6 'linux-tools-virtual',
7 'linux-virtual']
8
9- def _make_groups(self, cache, pkgs, eventloop_callback, to_remove=False, sensitive=True):
10+ def _make_groups(self, cache, pkgs, eventloop_callback, to_remove=False,
11+ sensitive=True):
12 if not pkgs:
13 return []
14 ungrouped_pkgs = []
15@@ -435,7 +436,8 @@ class UpdateList():
16 for pkg in pkgs:
17 app = self._get_application_for_package(pkg)
18 if app is not None:
19- app_group = UpdateApplicationGroup(pkg, app, to_remove, sensitive)
20+ app_group = UpdateApplicationGroup(pkg, app, to_remove,
21+ sensitive)
22 app_groups.append(app_group)
23 else:
24 ungrouped_pkgs.append(pkg)
25@@ -466,10 +468,13 @@ class UpdateList():
26 for pkg in ungrouped_pkgs:
27 if meta_group.is_dependency(pkg, cache, eventloop_callback):
28 if system_group is None:
29- system_group = UpdateSystemGroup(cache, to_remove, sensitive)
30+ system_group = UpdateSystemGroup(cache, to_remove,
31+ sensitive)
32 system_group.add(pkg)
33 else:
34- pkg_groups.append(UpdatePackageGroup(pkg, to_remove, sensitive))
35+ pkg_groups.append(UpdatePackageGroup(
36+ pkg, to_remove, sensitive)
37+ )
38
39 app_groups.sort(key=lambda a: a.name.lower())
40 pkg_groups.sort(key=lambda a: a.name.lower())
41@@ -516,7 +521,12 @@ class UpdateList():
42 pass
43 fake_ua_packages = []
44 ua_packages_names = []
45- for (package_name, version, size, downloadable) in ua_security_packages:
46+ for (
47+ package_name,
48+ version,
49+ size,
50+ downloadable
51+ ) in ua_security_packages:
52 if downloadable:
53 ua_packages_names.append(package_name)
54 else:
55@@ -571,7 +581,10 @@ class UpdateList():
56 if security_pkgs or upgrade_pkgs or pro_pkgs:
57 # There's updates available. Initiate the desktop file cache.
58 pkg_names = [p.name for p in
59- pro_pkgs + security_pkgs + upgrade_pkgs + kernel_autoremove_pkgs]
60+ pro_pkgs
61+ + security_pkgs
62+ + upgrade_pkgs
63+ + kernel_autoremove_pkgs]
64 self._populate_desktop_cache(pkg_names)
65 self.update_groups = self._make_groups(cache, upgrade_pkgs,
66 eventloop_callback)
67diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
68index 5c7acb1..49cbf69 100644
69--- a/UpdateManager/UpdateManager.py
70+++ b/UpdateManager/UpdateManager.py
71@@ -195,7 +195,7 @@ class UpdateManager(Gtk.Window):
72 self._start_pane(None)
73 sys.exit(0)
74
75- def show_settings(self, page_number = SoftwarePropertiesPage.updates):
76+ def show_settings(self, page_number=SoftwarePropertiesPage.updates):
77 try:
78 apt_pkg.pkgsystem_unlock()
79 except SystemError:
80@@ -266,12 +266,18 @@ class UpdateManager(Gtk.Window):
81 if package.get('service_name', '') == 'standard-security':
82 continue
83 status = package.get('status', '')
84- if status == 'pending_attach' or status == 'pending_enable' or status == 'upgrade_available':
85+ if (
86+ status == 'pending_attach'
87+ or status == 'pending_enable'
88+ or status == 'upgrade_available'
89+ ):
90 name = package.get('package', '')
91 version = package.get('version', '')
92 size = package.get('download_size', 0)
93 downloadable = status == 'upgrade_available'
94- self.ua_security_packages.append((name, version, size, downloadable))
95+ self.ua_security_packages.append(
96+ (name, version, size, downloadable)
97+ )
98
99 def _make_available_pane(self, install_count, need_reboot=False,
100 cancelled_update=False, error_occurred=False):
101diff --git a/UpdateManager/UpdatesAvailable.py b/UpdateManager/UpdatesAvailable.py
102index b9a07d7..dffa741 100644
103--- a/UpdateManager/UpdatesAvailable.py
104+++ b/UpdateManager/UpdatesAvailable.py
105@@ -251,7 +251,7 @@ class UpdatesAvailable(InternalDialog):
106 self.button_close = self.add_button(Gtk.STOCK_CANCEL,
107 self.window_main.close)
108 self.button_pro = self.add_button(_("Enable Ubuntu Pro..."),
109- self.on_button_pro_clicked)
110+ self.on_button_pro_clicked)
111 self.button_install = self.add_button(_("Install Now"),
112 self.on_button_install_clicked)
113 self.focus_button = self.button_install
114@@ -371,8 +371,9 @@ class UpdatesAvailable(InternalDialog):
115 from uaclient.api.u.apt_news.current_news.v1 import current_news
116 apt_news = current_news().current_news
117 except ImportError:
118- pro_client_apt_news_api_supported = False
119- apt_news = self._get_apt_news("/var/lib/ubuntu-advantage/messages/apt-news")
120+ apt_news = self._get_apt_news(
121+ "/var/lib/ubuntu-advantage/messages/apt-news"
122+ )
123 if apt_news:
124 self.news.get_buffer().set_text(apt_news)
125 self.expander_news.set_visible(True)
126@@ -522,14 +523,16 @@ class UpdatesAvailable(InternalDialog):
127
128 renderer.set_property("markup", markup)
129
130- def set_changes_buffer(self, changes_buffer, long_desc, text, name, srcpkg):
131- changes_buffer.set_text("") # Clear "downloading list of changes..."
132+ def set_changes_buffer(self, changes_buffer, long_desc, text, name,
133+ srcpkg):
134+ changes_buffer.set_text("") # Clear "downloading list of changes..."
135
136 # Write the technical description section
137 changes_buffer.insert_with_tags_by_name(changes_buffer.get_end_iter(),
138 "Technical description\n",
139 "descriptiontag")
140- changes_buffer.insert(changes_buffer.get_end_iter(), long_desc + "\n\n")
141+ changes_buffer.insert(changes_buffer.get_end_iter(),
142+ long_desc + "\n\n")
143
144 # Write the changes section
145 lines = text.split("\n")
146@@ -602,7 +605,8 @@ class UpdatesAvailable(InternalDialog):
147 if name in self.cache.all_changes:
148 changes = self.cache.all_changes[name]
149 srcpkg = self.cache[name].candidate.source_name
150- self.set_changes_buffer(changes_buffer, long_desc, changes, name, srcpkg)
151+ self.set_changes_buffer(changes_buffer, long_desc, changes, name,
152+ srcpkg)
153 # if not connected, do not even attempt to get the changes
154 elif not self.connected:
155 changes_buffer.set_text(
156@@ -649,7 +653,8 @@ class UpdatesAvailable(InternalDialog):
157 changes += self.cache.all_changes[name]
158
159 if changes or long_desc:
160- self.set_changes_buffer(changes_buffer, long_desc, changes, name, srcpkg)
161+ self.set_changes_buffer(changes_buffer, long_desc, changes, name,
162+ srcpkg)
163
164 def on_treeview_button_press(self, widget, event):
165 """
166@@ -788,8 +793,10 @@ class UpdatesAvailable(InternalDialog):
167 self.button_install.set_sensitive(True)
168 self.unity.set_install_menuitem_visible(True)
169 self.button_pro.destroy()
170- elif self.list.ubuntu_pro_fake_groups and not self.list.ubuntu_pro_groups:
171- download_str = _("You need to enable Ubuntu Pro to install these updates.")
172+ elif (self.list.ubuntu_pro_fake_groups
173+ and not self.list.ubuntu_pro_groups):
174+ download_str = _("You need to enable Ubuntu Pro to install"
175+ "these updates.")
176 self.button_install.destroy()
177 else:
178 download_str = _("There are no updates to install.")
179@@ -1110,19 +1117,27 @@ class UpdatesAvailable(InternalDialog):
180 self.list.kernel_autoremove_groups)
181 self._add_groups(self.list.kernel_autoremove_groups)
182 if self.list.ubuntu_pro_groups:
183- self._add_header(_("Ubuntu Pro security updates"), self.list.ubuntu_pro_groups, sensitive=True)
184+ self._add_header(
185+ _("Ubuntu Pro security updates"),
186+ self.list.ubuntu_pro_groups,
187+ sensitive=True
188+ )
189 self._add_groups(self.list.ubuntu_pro_groups)
190 if self.list.ubuntu_pro_fake_groups:
191- self._add_header(_("Ubuntu Pro security updates (enable in Settingsā€¦)"), self.list.ubuntu_pro_fake_groups, sensitive=False)
192+ self._add_header(
193+ _("Ubuntu Pro security updates (enable in Settingsā€¦)"),
194+ self.list.ubuntu_pro_fake_groups,
195+ sensitive=False
196+ )
197 self._add_groups(self.list.ubuntu_pro_fake_groups)
198
199 self.treeview_update.set_model(self.store)
200 self.pkg_cell_area.indent_toplevel = (
201- bool(self.list.ubuntu_pro_fake_groups) or
202- bool(self.list.ubuntu_pro_groups) or
203- bool(self.list.update_groups) or
204- bool(self.list.security_groups) or
205- bool(self.list.kernel_autoremove_groups))
206+ bool(self.list.ubuntu_pro_fake_groups)
207+ or bool(self.list.ubuntu_pro_groups)
208+ or bool(self.list.update_groups)
209+ or bool(self.list.security_groups)
210+ or bool(self.list.kernel_autoremove_groups))
211 self.update_close_button()
212 self.update_count()
213 self.setBusy(False)
214diff --git a/debian/changelog b/debian/changelog
215index 4be724a..6b247f4 100644
216--- a/debian/changelog
217+++ b/debian/changelog
218@@ -1,3 +1,10 @@
219+update-manager (1:18.04.11.19) UNRELEASED; urgency=medium
220+
221+ * Ubuntu Pro (LP: #1990450):
222+ - Address linter errors that cause autopkgtest to fail.
223+
224+ -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Thu, 05 Oct 2023 10:11:57 +0200
225+
226 update-manager (1:18.04.11.18) bionic; urgency=medium
227
228 * Ubuntu Pro (LP: #1990450):

Subscribers

People subscribed via source and target branches