Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
package-helpers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eliab Andi Artz
package-helpers
Commits
61503a5c
Commit
61503a5c
authored
5 years ago
by
Ruben Rodriguez
Browse files
Options
Downloads
Patches
Plain Diff
software-properties: fixed livepatch removal bug
parent
3136a2c9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
helpers/DATA/software-properties/disable-livepatch.patch
+87
-0
87 additions, 0 deletions
helpers/DATA/software-properties/disable-livepatch.patch
helpers/make-software-properties
+3
-2
3 additions, 2 deletions
helpers/make-software-properties
with
90 additions
and
2 deletions
helpers/DATA/software-properties/disable-livepatch.patch
0 → 100644
+
87
−
0
View file @
61503a5c
--- a/softwareproperties/LivepatchService.py 2020-01-06 15:10:21.950486591 -0500
+++ b/softwareproperties/LivepatchService.py 2020-01-06 15:07:49.294703393 -0500
@@ -29,8 +29,6 @@
import dateutil.parser
import requests_unixsocket
- gi.require_version('Snapd', '1')
- from gi.repository import Snapd
except(ImportError, ValueError):
pass
@@ -41,9 +39,6 @@
retry
)
-from softwareproperties.LivepatchSnap import LivepatchSnap
-
-
def datetime_parser(json_dict):
for (key, value) in json_dict.items():
try:
@@ -89,7 +84,6 @@
self._timeout_id = 0
- self._snap = LivepatchSnap()
self._session = requests_unixsocket.Session()
# Init Properties
@@ -129,8 +123,6 @@
# string rapresents the error message that needs to be shown if the
# callable returns false.
rules = [
- (lambda: self._snap.get_status() != Snapd.SnapStatus.UNKNOWN,
- _('Canonical Livepatch snap is not available.')),
(has_gnome_online_accounts,
_('Gnome Online Accounts is required to enable Livepatch.')),
(is_current_distro_lts,
@@ -177,16 +169,7 @@
Returns:
(False, '') if successful, (True, error_message) otherwise.
"""
- if self._enabled == enabled:
- return False, ''
-
- if not enabled:
- return self._disable_service()
- elif self._snap.get_status() == Snapd.SnapStatus.ACTIVE:
- return self._enable_service(token)
- else:
- success, msg = self._snap.enable_or_install()
- return self._enable_service(token) if success else (True, msg)
+ return self._disable_service()
def get_status(self):
"""Synchronously retrieve the status of Canonical Livepatch.
@@ -194,13 +177,7 @@
Returns:
str: The status. A valid string for success, None otherwise.
"""
- try:
- params = {'verbosity': 3, 'format': 'json'}
- r = self._session.get(self.STATUS_ENDPOINT, params=params)
- return r.json(object_hook=datetime_parser)
- except Exception as e:
- logging.debug('Failed to get Livepatch status: {}'.format(str(e)))
- return None
+ return None
# Private methods
def _enable_service(self, token):
--- a/softwareproperties/gtk/SoftwarePropertiesGtk.py 2020-01-06 15:10:21.970486562 -0500
+++ b/softwareproperties/gtk/SoftwarePropertiesGtk.py 2020-01-06 15:08:00.466687527 -0500
@@ -1038,12 +1037,7 @@
self.datadir)
d.run()
- self.quit_when_livepatch_responds = False
- if self.livepatch_page.waiting_livepatch_response:
- self.quit_when_livepatch_responds = True
- self.hide()
- else:
- self.quit()
+ self.quit()
def on_button_add_cdrom_clicked(self, widget):
""" when a cdrom is requested for adding """
This diff is collapsed.
Click to expand it.
helpers/make-software-properties
+
3
−
2
View file @
61503a5c
#!/bin/sh
#
# Copyright (C) 2011-20
16
Rub
é
n Rodr
í
guez <ruben@trisquel.info>
# Copyright (C) 2011-20
20
Rub
e
n Rodr
i
guez <ruben@trisquel.info>
# Copyright (C) 2011 Carlos Pais <freemind@lavabit.com>
# Copyright (C) 2019 Mason Hock <mason@masonhock.com>
#
...
...
@@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
VERSION=
2
VERSION=
3
. ./config
...
...
@@ -69,6 +69,7 @@ rm -rf tests
sed '/gir1.2-snapd-1/d' -i debian/control
sed '/self.init_livepatch/d' -i softwareproperties/gtk/SoftwarePropertiesGtk.py
patch -p0 < $DATA/remove_livepatch_from_gtk_ui.patch
patch -p1 < $DATA/disable-livepatch.patch
sed 's/status = self.get_status()/status = Snapd.SnapStatus.UNKNOWN/' -i softwareproperties/LivepatchSnap.py
rm data/software-properties-drivers.desktop.in
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment