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

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



On 12/22/2011 06:48 AM, Martin Gracik wrote:
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,

Ack.

--
David Cantrell <dcantrell redhat com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Westford, MA | EST5EDT


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