Skip to content

Commit

Permalink
Add skipped label to VMs excluded from updates
Browse files Browse the repository at this point in the history
  • Loading branch information
alimirjamali committed Oct 14, 2024
1 parent 0964df6 commit f54c803
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions qubesmanager/qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def __init__(self):
"update" : QIcon(":/update-recommended.png"),
"outdated" : QIcon(":/outdated.png"),
"to-be-outdated" : QIcon(":/to-be-outdated.png"),
"eol": QIcon(':/warning.png')
"eol": QIcon(':/warning.png'),
"skipped": QIcon(':/warning.png')
}
self.outdatedTooltips = {
"update" : self.tr("Updates pending!"),
Expand All @@ -114,7 +115,10 @@ def __init__(self):
"current session can be picked up by this qube."),
"eol": self.tr(
"This qube is based on a distribution that is no longer "
"supported\nInstall new template with Template Manager")
"supported\nInstall new template with Template Manager"),
"skipped": self.tr(
"This qube is skipped from updates!\n"
"This is an advanced feature. Use at your own risk")
}

def sizeHint(self, option, index):
Expand Down Expand Up @@ -245,6 +249,9 @@ def update_power_state(self):

if self.vm.klass in {'TemplateVM', 'StandaloneVM'}:
if manager_utils.get_feature(
self.vm, 'skip-update', False):
self.state['outdated'] = 'skipped'
elif manager_utils.get_feature(
self.vm, 'updates-available', False):
self.state['outdated'] = 'update'
elif manager_utils.get_feature(
Expand Down Expand Up @@ -1091,10 +1098,13 @@ def check_updates(self, info=None):
return

try:
if info.vm.klass in {'TemplateVM', 'StandaloneVM'} and \
manager_utils.get_feature(
if info.vm.klass in {'TemplateVM', 'StandaloneVM'}:
if manager_utils.get_feature(
info.vm, 'skip-update', False):
info.state['outdated'] = 'skipped'
elif manager_utils.get_feature(
info.vm, 'updates-available', False):
info.state['outdated'] = 'update'
info.state['outdated'] = 'update'
except exc.QubesDaemonAccessError:
return

Expand Down

0 comments on commit f54c803

Please sign in to comment.