[master 4/6] dd-refactor: new driver_updates.py + tests

wgwoods installerbot-noreply at redhat.com
Wed Jul 8 20:14:16 UTC 2015


In reply to line 196 of dracut/driver_updates.py:

Mostly: the previous version did it this way. Also the docstring for `shutil.move` says:

> A lot more could be done here...  A look at a mv.c shows a lot of
> the issues this implementation glosses over.

Also, `shutil.move` raises IOError if `dst` exists, so we have to wrap it in a try/except.. but what if `dst` is a symlink? Do we have to unlink it first? We may be copying across a filesystem boundary, so `os.rename()` won't work, and... ugh. It gets complicated very quickly.

I'd take a patch that replaced these with python versions, but this runs in a pretty strange environment so I'm not yet sure it's as easy as "just use the shutil versions instead". Need more unit tests here, I guess..

-- 
To view this comment on github, visit https://github.com/wgwoods/anaconda/commit/d2698c0e08d29b5754db8e7a42e1dfc7bd79e6aa#commitcomment-12070434


More information about the anaconda-patches mailing list