]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix IpNetnsCommand to execute without root_wrapper when no netns
authorMiguel Angel Ajo <mangelajo@redhat.com>
Mon, 18 Aug 2014 10:50:58 +0000 (12:50 +0200)
committerMiguel Angel Ajo <mangelajo@redhat.com>
Mon, 25 Aug 2014 19:21:21 +0000 (21:21 +0200)
commiteca9069be3d730c788e433edb291123eede07839
treeb5dc8178ebe93efe14923f297ffbe0407588d216
parent44eff5daad81966f6530d84ca3683b2f9c58debf
Fix IpNetnsCommand to execute without root_wrapper when no netns

IpNetnsCommand accept execution with a network namespace, and
that requires root privileges and a root_wrapper.
IpNetnsCommand does accept no namespace too, in that case, the
root_wrapper doesn't have to be present necessarily, unless the
command we're executing requires root privileges itself.

This patch fixes the check condition on IpNetnsCommand execute
method.

Change-Id: I5ab2f3f1daf4a5a080611dbcd3dbd43292f6766a
Closes-Bug: #1358196
neutron/agent/linux/ip_lib.py
neutron/tests/unit/test_linux_ip_lib.py