[PATCH] handle bug excluding groups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
there's a bug in handling exclusion of groups in pykickstart. Automated test
case template for SNAKE which contains:
ks.packages.add(['*'])
ks.packages.add(['-@conflicts'])

is generating incorrect ks.cfg:
%packages --ignoremissing
*

The conflicts group is a new group in RHEL5 which lists all packages conflicting
with packages from the base channel. Those are for example samba3x vs. samba,
freeradius2 vs. freeradius, etc. It is expected that QE will perform test cases
like:
@everything
-@conflicts

to verify that there are no unresolved dependencies or conflicts between all
base channel packages.

The comments in the code says "Support syntax for removing a previously included
group" but I think pykickstart doesn't know that * includes packages from
@conflicts as well.

Here are two different patches that fix the issue (and verified that generate
expected ks.cfg).

This one is proposed by James Laska:
--- /usr/lib/python2.5/site-packages/pykickstart/parser.py	2010-01-07
04:16:41.000000000 -0500
+++ /tmp/parser.py	2010-01-07 04:16:29.000000000 -0500
@@ -365,4 +365,3 @@
                         pass
-                else:
-                    newExcludedSet.add(stripped[1:])
+                newExcludedSet.add(stripped[1:])
             else:


This one is from myself:

diff --git a/pykickstart/parser.py b/pykickstart/parser.py
index 2e27f03..c03c666 100644
--- a/pykickstart/parser.py
+++ b/pykickstart/parser.py
@@ -365,6 +365,7 @@ class Packages(KickstartObject):
                 if stripped[1] == "@":
                     try:
                         self.groupList = filter(lambda g: g.name !=
stripped[2:], self.groupList)
+                        newExcludedSet.add(stripped[2:])
                     except ValueError:
                         pass
                 else:


--
Alexander.

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux