Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Kernel (http://www.linux-archive.org/debian-kernel/)
-   -   Check if the anaconda attribute is set in YumSorter (#756707) (http://www.linux-archive.org/debian-kernel/612778-check-if-anaconda-attribute-set-yumsorter-756707-a.html)

Martin Gracik 12-22-2011 10:48 AM

Check if the anaconda attribute is set in YumSorter (#756707)
 
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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 08:53 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.