From 7805f46d2b34e9018e53c7465184747c39ab544b Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Sep 12 2014 14:23:00 +0000 Subject: Fix a problem where urllib2 is not getting pulled into the initrd. python-six is too clever and quietly converts urllib imports into urllib2 imports, but in such a way that python-deps doesn't pick up on that fact. Thus, urllib2 is not in the initrd and kickstart installs hit a traceback when attempting to fetch the ks file. The result is either a regular interactive install or staring at a dracut prompt, depending on what else you are doing. There may be more of this in the future. --- diff --git a/dracut/python-deps b/dracut/python-deps index e626ff4..3ebb602 100755 --- a/dracut/python-deps +++ b/dracut/python-deps @@ -9,6 +9,8 @@ from distutils.sysconfig import * sitedir = get_python_lib() libdir = get_config_var('LIBDEST') +alsoNeeded = { libdir+"/urllib.py": libdir+"/urllib2.py" } + # A couple helper functions... def moduledir(pyfile): '''Given a python file, return the module dir it belongs to, or None.''' @@ -33,7 +35,7 @@ deps = [] for script in sys.argv[1:]: finder = ModuleFinder() finder.run_script(script) # parse the script - for name, mod in finder.modules.iteritems(): + for mod in finder.modules.itervalues(): if not mod.__file__: # this module is builtin, so we can skip it continue @@ -45,6 +47,9 @@ for script in sys.argv[1:]: deps += list(pyfiles(moddir)) # ...get the whole module mods.append(moddir) + if mod.__file__ in alsoNeeded: + deps.append(alsoNeeded[mod.__file__]) + # Include some bits that the python install itself needs print(get_makefile_filename()) print(get_config_h_filename())