Merge pull request #546 from dylanmtaylor/patch-1
Attempt to avoid crashing when encountering swap partitions in has_content
This commit is contained in:
commit
a4033a7d3a
|
|
@ -254,7 +254,8 @@ class Partition:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def has_content(self):
|
def has_content(self):
|
||||||
if not get_filesystem_type(self.path):
|
fs_type = get_filesystem_type(self.path)
|
||||||
|
if not fs_type or "swap" in fs_type:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
temporary_mountpoint = '/tmp/' + hashlib.md5(bytes(f"{time.time()}", 'UTF-8') + os.urandom(12)).hexdigest()
|
temporary_mountpoint = '/tmp/' + hashlib.md5(bytes(f"{time.time()}", 'UTF-8') + os.urandom(12)).hexdigest()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue