Mirantis/fuel — pull request #662 by bogdando (2013-10-09 15:06:00+00:00)
Title: PRD-2023: Ensure default route is purged before gateway-defined subint will be UP

ISSUE: Ubuntu affected only.
For vlan enabled interface with dhcp, default route would be created
on start-up time, thus, preventing gateway x.y.z.t would have been
added for default route on its static subinterface(vlan) start-up.

F.e. for eth0 auto with dhcp and its eth0.100 subint with gateway x.y.z.t defined:
1) eth0 starts up
2) default route have created for defined by dhcp gateway f.g.h.i
3) eth0.100 starts up
4) gateway x.y.z.t ignored as well ...
5) ???
6) profit

SOLUTION: add pre-up hook for gateway-defined subinterface to erase existing
default route (if any) configured since its main interface start-up.
That will ensure there is no default route exists after its main interface
start-up has been finished.
Notes:
-pre-up errors should be ignored to allow subint might be UP even
if there is no default route was configured before
-any alphanum (eth0, bond123, em8 etc.) main interface name should be matched as well
-if correct interface name cannot be matched from its subint name, use rescue "nullface" value

Fixes: #PRD-2023

Signed-off-by: Bogdan Dobrelya