Skip to content

Commit

Permalink
Add a pre-check to ensure Grub2 is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Sandakov committed Jul 29, 2024
1 parent be08596 commit bcf1862
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pleskdistup/actions/common_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,3 +625,14 @@ def __init__(self):

def _do_check(self) -> bool:
return os.path.exists("/etc/default/grub")


class AssertGrub2Installed(action.CheckAction):
def __init__(self):
self.name = "checking if grub2 is installed"
self.description = """Grub2 does not appear to be installed.
\tTo proceed with the conversion, please install the 'grub2' and/or 'grub2-common' packages
"""

def _do_check(self) -> bool:
return packages.is_package_installed("grub2-common")

0 comments on commit bcf1862

Please sign in to comment.