Bug 331091 - python-ruledispatch makes anaconda fail
python-ruledispatch makes anaconda fail
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Chris Lumens
Fedora Extras Quality Assurance
:
Depends On:
Blocks: K12LTSP F9Blocker
  Show dependency treegraph
 
Reported: 2007-10-13 21:19 EDT by Warren Togami
Modified: 2008-01-22 13:32 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-22 13:32:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to place /usr/lib/anaconda after RHUpdate paths in sys.path (840 bytes, patch)
2008-01-16 10:23 EST, Toshio Ernie Kuratomi
no flags Details | Diff

  None (edit)
Description Warren Togami 2007-10-13 21:19:18 EDT
Probing for video card:   Intel Corporation Mobile 945GM/GMS, 943/940GML Express
Integrated Graphics Controller
Starting graphical installation...
Traceback (most recent call last):
  File "/usr/sbin/anaconda", line 904, in <module>
    anaconda.setDispatch()
  File "/usr/sbin/anaconda", line 484, in setDispatch
    self.dispatch = dispatch.Dispatcher(self)
AttributeError: 'module' object has no attribute 'Dispatcher'

While attempting to use anaconda to build a chroot, it fails with this error
while python-ruledispatch is installed.  This is because the dispatch module
provided by ruledispatch has a higher precedence than anaconda's dispatch in
sys.path.
Comment 1 Warren Togami 2007-11-20 13:34:51 EST
--- anaconda.orig       2007-11-20 13:16:39.000000000 -0500
+++ anaconda    2007-11-20 13:20:49.000000000 -0500
@@ -301,7 +301,7 @@
         sys.path.append('textw')
         sys.path.append('iw')
     else:
-        sys.path.append('/usr/lib/anaconda')
+        sys.path.insert(0,'/usr/lib/anaconda')
         sys.path.append('/usr/lib/anaconda/textw')
         sys.path.append('/usr/lib/anaconda/iw')
 

This makes it work, although it is messy in the others append other private
paths and anaconda needs to be thoroughly tested to be sure this doesn't break
anything.
Comment 2 Chris Lumens 2007-11-20 14:26:01 EST
This breaks the RHupdates mechanism.  What needs to happen is that the
/usr/lib/anaconda paths be inserted into sys.path after all the updates paths.
Comment 3 Toshio Ernie Kuratomi 2008-01-16 10:22:40 EST
I'm not sure what the "updates paths" consist of, but the code in the following
patch might be sufficient if I've guessed right.  It seems a bit hacky, though.

A cleaner way to do this would be to make an anaconda module (either in
python_sitearch or as a subdirectory of %{_libdir}/anaconda) and put all the
code in there.  Then the code will be properly namespaced and you'll be able to
write unambiguous import statements like::
  from anaconda import dispatch
Comment 4 Toshio Ernie Kuratomi 2008-01-16 10:23:39 EST
Created attachment 291858 [details]
Patch to place /usr/lib/anaconda after RHUpdate paths in sys.path
Comment 5 Chris Lumens 2008-01-22 13:32:17 EST
Committed, with some slight modifications.  Thanks for the patch.

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