Wrong use of ">" to try to redirect output in _enable_hairpin
Bug #943316 reported by
Thierry Carrez
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Vish Ishaya |
Bug Description
nova/virt/
utils.execute(
This doesn't do what the author thinks it would do, since ">" is not interpreted as a redirection. It will actually copy stdin to 3 different locations. Luckily, this code probably works, though.
Changed in nova: | |
assignee: | nobody → Evan Callicoat (diopter) |
Changed in nova: | |
milestone: | none → essex-rc1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | essex-rc1 → 2012.1 |
To post a comment you must log in.
Good catch. I'm the author of this code and I was under the impression that utils.execute implied shell=True in the internal subprocess.popen call, but I see in utils.py that it assumes shell=False unless you specify a value, same as the popen default. I'll update my patch branch and either set shell=True or modify the code to use (sudo) sh -c "echo 1 > ..." instead of having tee's stdout to worry about in the first place.
It turns out that the code does indeed work just fine, enabling hairpin_mode on bridge ports successfully, but I'd definitely rather have it do so minus the cruft I stuffed in here.