Skip to content

Commit

Permalink
checking if snapshots has been enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed May 18, 2017
1 parent 6f3b6ff commit 2e07607
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/modules/AutoinstDrive.rb
Expand Up @@ -19,6 +19,7 @@ def main

Yast.import "AutoinstCommon"
Yast.import "AutoinstPartition"
Yast.import "Mode"

textdomain "autoinst"

Expand Down Expand Up @@ -363,7 +364,12 @@ def parseDrive(drive)
end

if newDrive["type"] != :CT_TMPFS
newDrive["enable_snapshots"] = true # enable snapshot (default)
if Mode.config && SCR.Execute(path(".target.bash"), "/usr/bin/snapper list") > 0
# Snapper returns an error if no snapshot has been defined.
newDrive["enable_snapshots"] = false
else
newDrive["enable_snapshots"] = true # enable snapshot (default)
end
newDrive["disklabel"] = drive["disklabel"] if drive.has_key?("disklabel")
else
newDrive.delete("disklabel")
Expand Down

0 comments on commit 2e07607

Please sign in to comment.