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

Proposed by Nathan Teodosio
Status: Merged
Approved by: Sebastien Bacher
Approved revision: d9687545386c1016c4a05d2e51d6f0ed38ab4afe
Merge reported by: Sebastien Bacher
Merged at revision: d9687545386c1016c4a05d2e51d6f0ed38ab4afe
Proposed branch: ~nteodosio/update-manager:jammy-ua
Merge into: update-manager:ubuntu/jammy
Diff against target: 241 lines (+71/-27)
4 files modified
UpdateManager/Core/UpdateList.py (+22/-7)
UpdateManager/UpdateManager.py (+11/-4)
UpdateManager/UpdatesAvailable.py (+31/-16)
debian/changelog (+7/-0)
Reviewer Review Type Date Requested Status
Sebastien Bacher Pending
Review via email: mp+452816@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks and sorry for not catching that before upload!

Revision history for this message
Sebastien Bacher (seb128) wrote :

It was merged into https://git.launchpad.net/update-manager/log/?h=ubuntu/jammy but launchpad didn't detect it since the target vcs there was the git-ubuntu import one, marking manually as merged now

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 8d30317..814d772 100644
3--- a/UpdateManager/Core/UpdateList.py
4+++ b/UpdateManager/Core/UpdateList.py
5@@ -391,7 +391,8 @@ class UpdateList():
6 return True
7 return False
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@@ -401,7 +402,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@@ -440,7 +442,8 @@ class UpdateList():
26 "linux-doc.*")
27 linux_regexp = re.compile("(" + "|".join(
28 ["^" + n for n in linux_names]) + ")")
29- ubuntu_base_group = UpdateGroup(None, None, None, to_remove, sensitive)
30+ ubuntu_base_group = UpdateGroup(None, None, None, to_remove,
31+ sensitive)
32 flavor_package = utils.get_ubuntu_flavor_package(cache=cache)
33 ubuntu_base_pkgs = [flavor_package,
34 "ubuntu-standard",
35@@ -458,10 +461,13 @@ class UpdateList():
36 if ubuntu_base_group.is_dependency(pkg, cache,
37 eventloop_callback):
38 if system_group is None:
39- system_group = UpdateSystemGroup(cache, to_remove, sensitive)
40+ system_group = UpdateSystemGroup(cache, to_remove,
41+ sensitive)
42 system_group.add(pkg)
43 else:
44- pkg_groups.append(UpdatePackageGroup(pkg, to_remove, sensitive))
45+ pkg_groups.append(UpdatePackageGroup(
46+ pkg, to_remove, sensitive)
47+ )
48
49 app_groups.sort(key=lambda a: a.name.lower())
50 pkg_groups.sort(key=lambda a: a.name.lower())
51@@ -511,7 +517,12 @@ class UpdateList():
52 pass
53 fake_ua_packages = []
54 ua_packages_names = []
55- for (package_name, version, size, downloadable) in ua_security_packages:
56+ for (
57+ package_name,
58+ version,
59+ size,
60+ downloadable
61+ ) in ua_security_packages:
62 if downloadable:
63 ua_packages_names.append(package_name)
64 else:
65@@ -573,7 +584,11 @@ class UpdateList():
66 if security_pkgs or upgrade_pkgs or pro_pkgs:
67 # There's updates available. Initiate the desktop file cache.
68 pkg_names = [p.name for p in
69- pro_pkgs + security_pkgs + upgrade_pkgs + kernel_autoremove_pkgs + duplicate_pkgs]
70+ pro_pkgs
71+ + security_pkgs
72+ + upgrade_pkgs
73+ + kernel_autoremove_pkgs
74+ + duplicate_pkgs]
75 self._populate_desktop_cache(pkg_names)
76 self.oem_groups = self._make_groups(cache, oem_pkgs,
77 eventloop_callback)
78diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
79index 259c0e6..2b0af65 100644
80--- a/UpdateManager/UpdateManager.py
81+++ b/UpdateManager/UpdateManager.py
82@@ -198,7 +198,7 @@ class UpdateManager(Gtk.Window):
83 self._start_pane(None)
84 sys.exit(0)
85
86- def show_settings(self, page_number = SoftwarePropertiesPage.updates):
87+ def show_settings(self, page_number=SoftwarePropertiesPage.updates):
88 cmd = ["/usr/bin/software-properties-gtk",
89 "--open-tab", str(page_number)]
90
91@@ -284,14 +284,21 @@ class UpdateManager(Gtk.Window):
92 time.sleep(0.05)
93 s = json.load(p.stdout)
94 for package in s.get('packages', []):
95- if package.get('service_name', '') == 'standard-security': continue
96+ if package.get('service_name', '') == 'standard-security':
97+ continue
98 status = package.get('status', '')
99- if status == 'pending_attach' or status == 'pending_enable' or status == 'upgrade_available':
100+ if (
101+ status == 'pending_attach'
102+ or status == 'pending_enable'
103+ or status == 'upgrade_available'
104+ ):
105 name = package.get('package', '')
106 version = package.get('version', '')
107 size = package.get('download_size', 0)
108 downloadable = status == 'upgrade_available'
109- self.ua_security_packages.append((name, version, size, downloadable))
110+ self.ua_security_packages.append(
111+ (name, version, size, downloadable)
112+ )
113
114 def _make_available_pane(self, install_count, need_reboot=False,
115 cancelled_update=False, error_occurred=False):
116diff --git a/UpdateManager/UpdatesAvailable.py b/UpdateManager/UpdatesAvailable.py
117index add06fe..5d254fe 100644
118--- a/UpdateManager/UpdatesAvailable.py
119+++ b/UpdateManager/UpdatesAvailable.py
120@@ -251,7 +251,7 @@ class UpdatesAvailable(InternalDialog):
121 self.button_close = self.add_button(Gtk.STOCK_CANCEL,
122 self.window_main.close)
123 self.button_pro = self.add_button(_("Enable Ubuntu Pro..."),
124- self.on_button_pro_clicked)
125+ self.on_button_pro_clicked)
126 self.button_install = self.add_button(_("Install Now"),
127 self.on_button_install_clicked)
128 self.focus_button = self.button_install
129@@ -371,8 +371,9 @@ class UpdatesAvailable(InternalDialog):
130 from uaclient.api.u.apt_news.current_news.v1 import current_news
131 apt_news = current_news().current_news
132 except ImportError:
133- pro_client_apt_news_api_supported = False
134- apt_news = self._get_apt_news("/var/lib/ubuntu-advantage/messages/apt-news")
135+ apt_news = self._get_apt_news(
136+ "/var/lib/ubuntu-advantage/messages/apt-news"
137+ )
138 if apt_news:
139 self.news.get_buffer().set_text(apt_news)
140 self.expander_news.set_visible(True)
141@@ -522,14 +523,16 @@ class UpdatesAvailable(InternalDialog):
142
143 renderer.set_property("markup", markup)
144
145- def set_changes_buffer(self, changes_buffer, long_desc, text, name, srcpkg):
146- changes_buffer.set_text("") # Clear "downloading list of changes..."
147+ def set_changes_buffer(self, changes_buffer, long_desc, text, name,
148+ srcpkg):
149+ changes_buffer.set_text("") # Clear "downloading list of changes..."
150
151 # Write the technical description section
152 changes_buffer.insert_with_tags_by_name(changes_buffer.get_end_iter(),
153 "Technical description\n",
154 "descriptiontag")
155- changes_buffer.insert(changes_buffer.get_end_iter(), long_desc + "\n\n")
156+ changes_buffer.insert(changes_buffer.get_end_iter(),
157+ long_desc + "\n\n")
158
159 # Write the changes section
160 lines = text.split("\n")
161@@ -604,7 +607,8 @@ class UpdatesAvailable(InternalDialog):
162 if name in self.cache.all_changes:
163 changes = self.cache.all_changes[name]
164 srcpkg = self.cache[name].candidate.source_name
165- self.set_changes_buffer(changes_buffer, long_desc, changes, name, srcpkg)
166+ self.set_changes_buffer(changes_buffer, long_desc, changes, name,
167+ srcpkg)
168 # if not connected, do not even attempt to get the changes
169 elif not self.connected:
170 changes_buffer.set_text(
171@@ -651,7 +655,8 @@ class UpdatesAvailable(InternalDialog):
172 changes += self.cache.all_changes[name]
173
174 if changes or long_desc:
175- self.set_changes_buffer(changes_buffer, long_desc, changes, name, srcpkg)
176+ self.set_changes_buffer(changes_buffer, long_desc, changes, name,
177+ srcpkg)
178
179 def on_treeview_button_press(self, widget, event):
180 """
181@@ -791,8 +796,10 @@ class UpdatesAvailable(InternalDialog):
182 self.button_install.set_sensitive(True)
183 self.unity.set_install_menuitem_visible(True)
184 self.button_pro.destroy()
185- elif self.list.ubuntu_pro_fake_groups and not self.list.ubuntu_pro_groups:
186- download_str = _("You need to enable Ubuntu Pro to install these updates.")
187+ elif (self.list.ubuntu_pro_fake_groups
188+ and not self.list.ubuntu_pro_groups):
189+ download_str = _("You need to enable Ubuntu Pro to install"
190+ "these updates.")
191 self.button_install.destroy()
192 else:
193 download_str = _("There are no updates to install.")
194@@ -1122,18 +1129,26 @@ class UpdatesAvailable(InternalDialog):
195 self.list.duplicate_groups)
196 self._add_groups(self.list.duplicate_groups)
197 if self.list.ubuntu_pro_groups:
198- self._add_header(_("Ubuntu Pro security updates"), self.list.ubuntu_pro_groups, sensitive=True)
199+ self._add_header(
200+ _("Ubuntu Pro security updates"),
201+ self.list.ubuntu_pro_groups,
202+ sensitive=True
203+ )
204 self._add_groups(self.list.ubuntu_pro_groups)
205 if self.list.ubuntu_pro_fake_groups:
206- self._add_header(_("Ubuntu Pro security updates (enable in Settingsā€¦)"), self.list.ubuntu_pro_fake_groups, sensitive=False)
207+ self._add_header(
208+ _("Ubuntu Pro security updates (enable in Settingsā€¦)"),
209+ self.list.ubuntu_pro_fake_groups,
210+ sensitive=False
211+ )
212 self._add_groups(self.list.ubuntu_pro_fake_groups)
213
214 self.treeview_update.set_model(self.store)
215 self.pkg_cell_area.indent_toplevel = (
216- bool(self.list.ubuntu_pro_fake_groups) or
217- bool(self.list.ubuntu_pro_groups) or
218- bool(self.list.update_groups) or
219- bool(self.list.security_groups)
220+ bool(self.list.ubuntu_pro_fake_groups)
221+ or bool(self.list.ubuntu_pro_groups)
222+ or bool(self.list.update_groups)
223+ or bool(self.list.security_groups)
224 or bool(self.list.kernel_autoremove_groups)
225 or bool(self.list.duplicate_groups))
226 self.update_close_button()
227diff --git a/debian/changelog b/debian/changelog
228index 749da13..1bf015b 100644
229--- a/debian/changelog
230+++ b/debian/changelog
231@@ -1,3 +1,10 @@
232+update-manager (1:22.04.15) UNRELEASED; urgency=medium
233+
234+ * Ubuntu Pro (LP: #1990450):
235+ - Address linter errors that cause autopkgtest to fail.
236+
237+ -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Wed, 04 Oct 2023 15:29:45 +0200
238+
239 update-manager (1:22.04.14) jammy; urgency=medium
240
241 * Ubuntu Pro (LP: #1990450):

Subscribers

People subscribed via source and target branches