Bug 558516 - RFE: Better groups exclusion support
Summary: RFE: Better groups exclusion support
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: anaconda
Version: 5.5
Hardware: All
OS: Linux
high
high
Target Milestone: beta
: ---
Assignee: Anaconda Maintenance Team
QA Contact: Alexander Todorov
URL:
Whiteboard:
Depends On: 554717 555311
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-25 15:22 UTC by Alexander Todorov
Modified: 2010-03-30 08:00 UTC (History)
3 users (show)

Fixed In Version: anaconda-11.1.2.202-1
Doc Type: Enhancement
Doc Text:
Clone Of: 555311
Environment:
Last Closed: 2010-03-30 08:00:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
anacdump.txt from testing with updates.img (54.63 KB, text/plain)
2010-01-26 13:22 UTC, Alexander Todorov
no flags Details
anaconda.log from testing with updates.img (1.38 MB, text/plain)
2010-01-26 15:36 UTC, Alexander Todorov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0194 0 normal SHIPPED_LIVE anaconda bug fix and enhancement update 2010-03-29 12:24:02 UTC

Comment 1 Alexander Todorov 2010-01-25 15:23:41 UTC
Cloning against anaconda then. Please see the file conflict in bug #552219. QE is still seeing this even with *-@conflicts. 552219 is probbaly a duplicate of this one.

Comment 3 Chris Lumens 2010-01-25 15:56:34 UTC
If you have a tree with pykickstart-0.43.8, can you add updates=http://clumens.fedorapeople.org/558516.img and see if this fixes the problem?  Thanks.

Comment 6 Alexander Todorov 2010-01-26 13:22:58 UTC
Created attachment 386829 [details]
anacdump.txt from testing with updates.img

Chris,
testing with anaconda-11.1.2.200-1, pykickstart-0.43.8-1.el5 and your updates.img gave me a traceback. Full anacdump.txt is attached.

Traceback (most recent call first):
  File "/tmp/updates/kickstart.py", line 1099, in setGroupSelection
    self.ksdata.packages.excludedGroupList)
  File "/usr/lib/anaconda/backend.py", line 191, in doBasePackageSelect
    anaconda.id.instClass.setGroupSelection(anaconda)
  File "/usr/lib/anaconda/dispatch.py", line 201, in moveStep
    rc = stepFunc(self.anaconda)
  File "/usr/lib/anaconda/dispatch.py", line 124, in gotoNext
    self.moveStep()
  File "/usr/lib/anaconda/gui.py", line 1156, in nextClicked
    self.anaconda.dispatch.gotoNext()
  File "/usr/lib/anaconda/gui.py", line 1290, in keyRelease
    self.nextClicked()
AttributeError: KickstartData instance has no attribute 'packages'

Same thing with anaconda-11.1.2.201-2 and latest nightly build.

Comment 7 Chris Lumens 2010-01-26 15:08:04 UTC
Can you give the same test another try with the same updates image?

Comment 8 Alexander Todorov 2010-01-26 15:32:49 UTC
Tested again with latest nightly and the updates.img. my ks.cfg has:
%packages
*
-@conflicts

Anaconda was able to proceed to packages installation step. After calculating dependencies it showed a message with file conflicts. anaconda.log shows that postgresql-devel conflicts with postgresql84-devel although postgresql84-devel is in the conflicts group. This is on i386 virtual machine. Will attach anaconda.log shortly.

Comment 9 Alexander Todorov 2010-01-26 15:36:12 UTC
Created attachment 386858 [details]
anaconda.log from testing with updates.img

Comment 10 Chris Lumens 2010-01-26 16:32:19 UTC
Not sure I quite understand what's going on here.  James - anaconda is simply calling:

    map(anaconda.backend.deselectGroup, self.ksdata.excludedGroupList)

where self.ksdata.excludedGroupList is just a list of group names.  Down in deselectGroup in yum/__init__py:2216, I'm hitting the ValueError there because txmbr.groups is empty for at least one of the packages in the @conflicts group.  Therefore, we continue and never remove the package.

I know this is a pretty weird corner case, so it's entirely likely this is supposed to be the proper behavior.  Is there perhaps a different method I should be calling to make sure all packages in the conflicts group get removed?

Comment 11 James Antill 2010-01-26 17:26:01 UTC
Yeh, deselectGroup() is just meant to undo selectGroup() ... and we never call it internally. It's even documented that way. I agree that the "instantly stop+return when we hit a package not from the group" is bad though, I think that's an obvious fix (atm. what gets "deselected" depends on the order of packages we hit ... so that's bad). But I don't think that fix is what you want either, is it?

I think what you really want is "selectRemoveGroup()" no? Ie. go through the group and try to remove each package whether it's in other groups or was selected manually etc?

Comment 12 James Antill 2010-01-26 17:31:59 UTC
Wait, we don't return we continue ... so ignore my obvious fix comment. I think deselectGroup is dtrt. But I'm positive that's not the API you want now (at least atm.).

It might be easier, esp. for 5.5 to just paste the (untested) quick:

for grp in yb.comps.return_groups(grpid):
    for pkgname in grp.packages:
        for txmbr in self.tsInfo:
            if txmbr.po.name == pkgname and txmbr.po.state in TS_INSTALL_STATES:
                    yb.tsInfo.remove(txmbr.po.pkgtup)
                            
                    for pkg in self.tsInfo.conditionals.get(txmbr.name, []):
                        self.tsInfo.remove(pkg.pkgtup)

...post 5.5, I'm happy to propose a force=False arg. to deselectGroup() to have that behaviour.

Comment 13 Chris Lumens 2010-01-26 18:38:06 UTC
You're suggesting I put that into yuminstall.py for rhel5 anaconda?

And yes, we will definitely want something here for rhel6 and Fedora as well, since we support the same group removal syntax there.

Comment 14 James Antill 2010-01-26 20:42:11 UTC
yeh, putting that into yuminstall directly for RHEL-5 is probably easiest.

I can probably get the API updated for RHEL-6, and backport to 5.6 if you want to get rid of your code.

Comment 15 Chris Lumens 2010-01-26 22:04:06 UTC
Alexander - can you try one more time with the same updates image?  I've got an install going here that's installing packages, but it's not going to be done in time for me to see if it's working completely tonight.  We got past the transaction test, though.

Comment 16 Alexander Todorov 2010-01-27 12:42:20 UTC
Chris,
with the RHEL5.5-Server-20100117.0 tree and the updates.img I got this traceback:

File "/tmp/updates/backend.py", line 150
  def removeGroupsPackages(self, grp, *args)
                                           ^

SyntaxError: invalid syntax

same with latest nightly

Comment 17 Chris Lumens 2010-01-27 16:39:56 UTC
Okay, I've fixed that locally and given it a test here.  I have confirmed that no postgresql84-* packages are installed, which I believe is the desired behavior here.

Comment 20 Alexander Todorov 2010-02-01 14:55:56 UTC
This works with RHEL5.5-Server-20100129.nightly/anaconda-11.1.2.202-2/pykickstart-0.43.8-1 on x86_64

Automated RHTS job:
http://rhts.redhat.com/cgi-bin/rhts/jobs.cgi?id=121612&type=Single

ks.cfg has:
%packages
*
-@conflicts

No file conflicts are present, postgresql, samba and freeradius packages are installed. Their conflicting counterparts are not as expected. Moving to VERIFIED.

Comment 22 errata-xmlrpc 2010-03-30 08:00:38 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0194.html


Note You need to log in before you can comment on or make changes to this bug.