]> git.proxmox.com Git - mirror_ifupdown2.git/commit - addons/vrf.py
addons: vrf: vrf_slave: up vrf dev only when all interfaces are being
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Sat, 14 May 2016 05:44:50 +0000 (22:44 -0700)
committerRoopa Prabhu <roopa@cumulusnetworks.com>
Sat, 14 May 2016 06:42:28 +0000 (23:42 -0700)
commitd2b357167d55b49d572f0a4de09632e4f8e5d470
tree7cfcade19f56fe5964d81e25df4d3b1ad9ea5b57
parentcbdde74e166e5658098b154f1d4843c600bd2ab7
addons: vrf: vrf_slave: up vrf dev only when all interfaces are being
brought up

Ticket: CM-10954, CM-10953
Reviewed By: julien
Testing Done: ran ifupdown2 smoke and vrf ifup/ifdown testing

- vrf master if not around is brought up when the first slave is brought up
by design (because we want the slaves to be
enslaved to a vrf master before addresses are configured).
and master is not brought up by first because interfaces
are brought up down to top in the dependency tree.

- This patch makes sure a slave brings up a vrf master only
when all interfaces are specified. When an individual interface
is brought up, skip master bring up and throw an error.

- Since the addon modules also need to use the ALL and WITH_DEPENDS
  flags, this patch moves them to the existing global ifupdownflags
  class

- vrf module uses the ifupdownflags.ALL flag to not bring up the master
when only the slave is being brought up

example:
ifup <vrf>      # brings up the vrf device
ifup <vrf> --with-depends  # brings up the vrf dev and
# its slaves
ifup <vrf_slave> # if vrf master is not around,
# an error is thrown
ifup <vrf_slave> --with-depends # will still not bring up the vrf master

ifdown <vrf> # deletes vrf dev and flushes the
# addresses on vrf slaves
ifup <vrf> # brings up vrf dev and does not
# up the adresses on the slaves
ifup <vrf> --with-depends # will bring up vrf and reapply config
# on slaves (including addresses)

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
addons/vrf.py
ifupdown/ifupdownflags.py
ifupdown/ifupdownmain.py
ifupdown/scheduler.py