Bug 2054906

Summary: Backport package section argument validation fixes
Product: Red Hat Enterprise Linux 9 Reporter: Brian Lane <bcl>
Component: pykickstartAssignee: Brian Lane <bcl>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: jstodola
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pykickstart-3.32.4-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 14:13:27 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 Brian Lane 2022-02-16 00:12:06 UTC
https://github.com/pykickstart/pykickstart/issues/395 reported that ksvalidator was returning incorrect results for the `%package` section arguments that have have all lower case options added.

This has been fixed upstream and needs to be backported for 9.0

User's report was:

I have a two kickstarts, one for RHEL8 and another for RHEL9 that only differ in one detail:

    rhel8.ks:%packages --excludedocs --nocore --instLangs=en
    rhel9.ks:%packages --excludedocs --nocore --inst-langs=en

On pykickstart-3.16.14-1.el8, ksvalidator works as would be expected. ksvalidator -v RHEL8 rhel8.ks validates successfully and ksvalidator -v RHEL8 rhel9.ks fails with this error:

The following problem occurred on line 16 of the kickstart file:

unrecognized arguments: --inst-langs=en

However, on pykickstart-3.32.2-2.el9, it seems that the arguments are ignored completely:

    ksvalidator -v RHEL8 rhel8.ks: passes, OK
    ksvalidator -v RHEL8 rhel9.ks: passes, should fail
    ksvalidator -v RHEL9 rhel8.ks: passes, should fail (instLangs is deprecated)
    ksvalidator -v RHEL9 rhel9.ks: passes, OK

I replicated the same behavior with the latest release, from this repo pykickstart-3.34.

Comment 2 Jan Stodola 2022-02-22 12:18:16 UTC
pykickstart-3.32.4-1.el9 looks good:

[root@localhost ~]# cat rhel8.ks 
%packages --instLangs=en --excludeWeakdeps
%end
[root@localhost ~]# cat rhel9.ks 
%packages --inst-langs=en --exclude-weakdeps
%end
[root@localhost ~]#


Reproduction with old pykickstart:

[root@localhost ~]# rpm -q pykickstart
pykickstart-3.32.2-2.el9.noarch
[root@localhost ~]# ksvalidator -v RHEL8 rhel8.ks && echo PASS || echo FAIL
PASS
[root@localhost ~]# ksvalidator -v RHEL8 rhel9.ks && echo PASS || echo FAIL
PASS
[root@localhost ~]# ksvalidator -v RHEL9 rhel8.ks && echo PASS || echo FAIL
The --excludeWeakdeps option on line 1 will be deprecated in future releases. Please modify your kickstart file to replace this option with its preferred alias --exclude-weakdeps.
FAIL
[root@localhost ~]# ksvalidator -v RHEL9 rhel9.ks && echo PASS || echo FAIL
PASS
[root@localhost ~]#


With pykickstart-3.32.4-1.el9 the behavior is correct:

[root@localhost ~]# rpm -q pykickstart
pykickstart-3.32.4-1.el9.noarch
[root@localhost ~]# ksvalidator -v RHEL8 rhel8.ks && echo PASS || echo FAIL
PASS
[root@localhost ~]# ksvalidator -v RHEL8 rhel9.ks && echo PASS || echo FAIL
The following problem occurred on line 1 of the kickstart file:

unrecognized arguments: --inst-langs=en --exclude-weakdeps

FAIL
[root@localhost ~]# ksvalidator -v RHEL9 rhel8.ks && echo PASS || echo FAIL
The --instLangs option on line 1 will be deprecated in future releases. Please modify your kickstart file to replace this option with its preferred alias --inst-langs.
FAIL
[root@localhost ~]# ksvalidator -v RHEL9 rhel9.ks && echo PASS || echo FAIL
PASS
[root@localhost ~]#

Comment 3 Jan Stodola 2022-02-23 17:17:22 UTC
Verified:Tested based on comment 2.

Comment 6 Jan Stodola 2022-02-25 16:18:37 UTC
pykickstart-3.32.4-1.el9 is included in RHEL-9.0.0-20220225.1.

Moving to VERIFIED.

Comment 8 errata-xmlrpc 2022-05-17 14:13:27 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 (new packages: pykickstart), 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-2022:2674