Bug 1722262

Summary: If _netdev is specified as a --fsoption option in kickstart, it should be included in the /etc/fstab but blivet removes the option if the drive is not a network drive
Product: Red Hat Enterprise Linux 8 Reporter: jcastran
Component: python-blivetAssignee: Vojtech Trefny <vtrefny>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.1CC: andrew_desiervo, jcall, jstodola, pzatko, rhandlin, vtrefny
Target Milestone: rc   
Target Release: 8.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: python-blivet-3.2.2-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 03:22:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jcastran 2019-06-19 20:40:08 UTC
Description of problem:
When using a kickstart and specifying the --fsoption as _netdev, blivet will remove the option if the drive is not a network accessible drive. 

Version-Release number of selected component (if applicable):
RHEL 7
RHEL 8

How reproducible:
Everytime

Steps to Reproduce:
1. Using a kickstart, add --fsoptions="_netdev" to any part or logvol command
2. Build the system
3.

Actual results:
Unless this is a network drive, the option will be removed

Expected results:
The option should be in /etc/fstab since it was explicitly configured

Additional info:

blivet/storage.py

    def _update_netdev_mount_option(self):
        """ Fix mount options to include or exclude _netdev as appropriate. """
        if not hasattr(self._format, "mountpoint"):
            return

        netdev_option = "_netdev"
        option_list = self._format.options.split(",")
        is_netdev = any(isinstance(a, NetworkStorageDevice)
                        for a in self.ancestors)
        has_netdev_option = netdev_option in option_list
        if not is_netdev and has_netdev_option:
            option_list.remove(netdev_option)
            self._format.options = ",".join(option_list)
        elif is_netdev and not has_netdev_option:
            option_list.append(netdev_option)
            self._format.options = ",".join(option_list)

Comment 1 John Call 2019-09-06 21:39:04 UTC
I'm running into this issue while trying to configure LUKS + Clevis/Tang during kickstart.  It would be nice if blivet didn't remove this...

Comment 10 errata-xmlrpc 2020-11-04 03:22:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (python-blivet bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4728