Allowing individual partitions safety checks to rely on the parent blockdevice keep_partitions status.
This commit is contained in:
parent
5e9c973d42
commit
f3907310e3
|
|
@ -237,6 +237,9 @@ class Partition():
|
||||||
return True if files > 0 else False
|
return True if files > 0 else False
|
||||||
|
|
||||||
def safe_to_format(self):
|
def safe_to_format(self):
|
||||||
|
if self.block_device and self.block_device.keep_partitions is True:
|
||||||
|
return True
|
||||||
|
|
||||||
if self.allow_formatting is False:
|
if self.allow_formatting is False:
|
||||||
log(f"Partition {self} is not marked for formatting.", level=LOG_LEVELS.Debug)
|
log(f"Partition {self} is not marked for formatting.", level=LOG_LEVELS.Debug)
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue