Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[storage] marks actual devices as protected/unprotected (avoids ancestors) #5243

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions pyanaconda/modules/storage/devicetree/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,22 +350,16 @@ def protect_devices(self, protected_names):
self.protected_devices = protected_names

def _mark_protected_device(self, device):
"""Mark a device and its ancestors as protected."""
if not device:
return

for d in device.ancestors:
log.debug("Marking device %s as protected.", d.name)
d.protected = True
"""Mark a device as protected from teardown."""
if device:
log.debug("Marking device %s as protected.", device.name)
device.protected = True

def _mark_unprotected_device(self, device):
"""Mark a device and its ancestors as unprotected."""
if not device:
return

for d in device.ancestors:
log.debug("Marking device %s as unprotected.", d.name)
d.protected = False
"""Mark a device as unprotected from teardown."""
if device:
log.debug("Marking device %s as unprotected.", device.name)
device.protected = False

@property
def usable_disks(self):
Expand Down