Skip to content

Commit

Permalink
fix(middlewared/disk): do not try to savecore on used single disk swap
Browse files Browse the repository at this point in the history
Ticket:	NAS-101185
  • Loading branch information
william-gr committed Apr 12, 2019
1 parent 1b35f6a commit 27c51b2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/middlewared/middlewared/plugins/disk.py
Expand Up @@ -1323,10 +1323,12 @@ async def swaps_configure(self):

# Add non-mirror swap devices
# e.g. when there is a single disk
swap_devices += [
i.devname.replace('.eli', '')
for i in getswapinfo() if not i.devname.startswith('mirror/')
]
for i in getswapinfo():
if i.devname.startswith('mirror/'):
continue
devname = i.devname.replace('.eli', '')
swap_devices.append(devname)
used_partitions.add(devname)

# Get all partitions of swap type, indexed by size
swap_partitions_by_size = defaultdict(list)
Expand Down

0 comments on commit 27c51b2

Please sign in to comment.