]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Change linux/ip_lib code to better handle address families
authorBrian Haley <brian.haley@hp.com>
Thu, 19 Feb 2015 19:50:43 +0000 (14:50 -0500)
committerBrian Haley <brian.haley@hp.com>
Tue, 10 Mar 2015 04:17:24 +0000 (00:17 -0400)
commitb9e02f22ef20c2080e95b582694063165e920b66
treece98ae124bf7ae39338753ba090269548122c3d7
parent4ced2d1a8650db3c69f61325ca4cabd90bc497e6
Change linux/ip_lib code to better handle address families

The code in linux/ip_lib doesn't handle IP address families
similarly amongst all its APIs.  It also doesn't consistently
handle how it passes options and arguments along to /sbin/ip

So in the spirit of re-factoring, let's try and fix that:

1. Have the code determine the IP address family from its
   arguments, given that it was passed an IP address.

2. Always follow an (options, command, arguments) style.
   Options need a '-' prepended and go first, followed by the
   command, and finally by any arguments.

3. In cases where we can't infer an address family but need
   one it is now required (e.g. listing routes).

I also cleaned-up the IpRule class to fall in line with the
other classes.

Change-Id: Idcb9af698e3ea2d99a6a281c86fa13f51499b628
Closes-Bug: #1419805
18 files changed:
neutron/agent/l3/agent.py
neutron/agent/l3/dvr.py
neutron/agent/l3/dvr_router.py
neutron/agent/l3/ha_router.py
neutron/agent/l3/router_info.py
neutron/agent/linux/dhcp.py
neutron/agent/linux/interface.py
neutron/agent/linux/ip_lib.py
neutron/common/constants.py
neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
neutron/tests/functional/agent/linux/base.py
neutron/tests/functional/agent/linux/test_ip_monitor.py
neutron/tests/unit/agent/l3/test_dvr_router.py
neutron/tests/unit/agent/l3/test_l3_router.py
neutron/tests/unit/agent/l3/test_legacy_router.py
neutron/tests/unit/test_l3_agent.py
neutron/tests/unit/test_linux_interface.py
neutron/tests/unit/test_linux_ip_lib.py