Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-30406

pykickstart doesn't apply all options for "network" directive when the directive is specified in an included file

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • rhel-9.5
    • rhel-8.9.0, rhel-9.3.0
    • anaconda
    • None
    • anaconda-34.25.5.5-1.el9
    • Normal
    • sst_installer
    • ssg_front_door
    • 14
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Red Hat Enterprise Linux
    • Bug Fix
    • Hide
      Cause (the user action or circumstances that trigger the bug):
      Consequence (what the user experience is when the bug occurs):
      Fix (what has changed to fix the bug; do not include overly technical details):
      Result (what happens now that the patch is applied):
      Show
      Cause (the user action or circumstances that trigger the bug): Consequence (what the user experience is when the bug occurs): Fix (what has changed to fix the bug; do not include overly technical details): Result (what happens now that the patch is applied):
    • Proposed

      What were you trying to do that didn't work?

      A customer wants to use dhcpclass when requesting an IP address for installation.
      Initially he adds "inst.dhcpclass=RHEL" to the kernel command line, which works fine.
      Then in the kickstart he observed the following:

      • if "network" directive is directly written in the kickstart it works fine
        network ... --bootproto=dhcp --device=link --noipv6 --activate --dhcpclass=RHEL
      • however if "network" directive is added to an included file, dhcpclass is not taken into account
        %pre
        echo "network ... --bootproto=dhcp --device=link --noipv6 --activate --dhcpclass=RHEL" > /tmp/network.inc
        %end
        %include /tmp/network.inc

      I can reproduce the issue with both RHEL8.9 and RHEL9.3 DVD.

      Apparently when %include is specified, it's different code that evaluate the "network" directive, but I wasn't able to understand which code executes yet.

      For sure, I see a difference in network interface naming (independent of whether --dhcpclass is specified or not):

      • WITHOUT %include, interface is named System enp1s0:
        [anaconda root@localhost ~]# nmcli con show
        NAME              UUID                                  TYPE      DEVICE 
        System enp1s0     70af0392-783a-4e89-b104-d12a9c53f629  ethernet  enp1s0 
        Wired Connection  8b44ee13-ad17-4300-a16b-0f2ff06c3cb4  ethernet  --     
        [anaconda root@localhost ~]# nmcli con show "System enp1s0" | grep vendor
        ipv4.dhcp-vendor-class-identifier:      RHEL
      • WITH %include, interface is name enp1s0:
        [anaconda root@localhost ~]# nmcli con show
        NAME              UUID                                  TYPE      DEVICE 
        enp1s0            18e7ed12-f918-4e4b-976f-d364c2d035d4  ethernet  enp1s0 
        Wired Connection  76854734-08cf-41bb-b793-279fe041f4be  ethernet  --     
        [anaconda root@localhost ~]# nmcli con show enp1s0 | grep vendor
        ipv4.dhcp-vendor-class-identifier:      --

      This denotes different code handling for sure.

      Please provide the package NVR for which bug is seen:

      pykickstart 8.9 and 9.3

      How reproducible:

      Always

            rvykydal@redhat.com Radek Vykydal
            rhn-support-rmetrich Renaud Metrich
            anaconda-maint-list anaconda-maint-list
            Release Test Team Release Test Team
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: