Skip to content

Commit

Permalink
fixup! Duplicate bottle as subvolumes
Browse files Browse the repository at this point in the history
  • Loading branch information
Borgvall committed Jul 13, 2024
1 parent 1ae06df commit 3ead90d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bottles/backend/models/btrfssubvolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DuplicateResult(Enum):
NOTHING = 1
EMPTY_SUBVOLUMES = 2
SNAPSHOTS_FROM_SOURCE = 3

def destination_directories_created(self) -> bool:
return not self == DuplicateResult.NOTHING

Expand Down Expand Up @@ -93,7 +93,10 @@ def create_bare_destination() -> DuplicateResult:
if not btrfsutil.is_subvolume(internal_source_path):
continue
internal_destination_path = os.path.join(destination_path, internal_subvolume)
if os.path.isdir(internal_destination_path):
os.rmdir(internal_destination_path)
btrfsutil.create_snapshot(internal_source_path, internal_destination_path, read_only=False)
return DuplicateResult.SNAPSHOTS_FROM_SOURCE

def try_create_bottle_snapshots_handle(bottle_path):
"""Try to create a bottle snapshots handle.
Expand Down

0 comments on commit 3ead90d

Please sign in to comment.