[rhel5-branch] Check if the anaconda attribute is set in YumSorter (#756707)

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

 



The YumSorter class is used in pkgorder script during the compose.
If it's run this way the class does not have the anaconda attribute
set, so we need to make sure we do not try to access it.
---
 yuminstall.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index 984366a..46ac375 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -462,9 +462,11 @@ class YumSorter(yum.YumBase):
                     continue
 
                 # XXX: ATTENTION the self.anaconda is in the AnacondaYum class,
-                # which subclasses this class and inherits this method and is actually used;
+                # which subclasses this class and inherits this method;
                 # very ugly, but I don't want to move the whole method...
-                if (self.anaconda.isKickstart and
+                # do this part only if it's used from AnacondaYum class,
+                # pkgorder uses the YumSorter class, but does not need this functionality
+                if (hasattr(self, 'anaconda') and self.anaconda.isKickstart and
                         'conflicts' in map(str.lower, self.anaconda.id.ksdata.excludedGroupList)):
 
                     # get the list of packages in @conflicts group for the first time,
-- 
1.7.5.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux