1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

ifupdown: add new ifupdownflags class to carry ifupdown flags

Ticket: cleanup
Reviewed By:
Testing Done: Tested ifupdown sanity

This gets rid of some ugly previous flag handling which was
passed through modules. This creates a global instance of
flags that all addon modules and helper modules can use.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This commit is contained in:
Roopa Prabhu
2016-04-14 14:45:47 -07:00
parent 96a71b65cb
commit fc5e1735c0
24 changed files with 144 additions and 151 deletions

View File

@@ -8,6 +8,7 @@ from ifupdown.iface import *
from ifupdownaddons.modulebase import moduleBase
from ifupdownaddons.iproute2 import iproute2
from ifupdownaddons.bridgeutils import brctl
import ifupdown.ifupdownflags as ifupdownflags
import logging
class bridgevlan(moduleBase):
@@ -67,7 +68,7 @@ class bridgevlan(moduleBase):
return
running_mcqv4src = {}
if not self.PERFMODE:
if not ifupdownflags.flags.PERFMODE:
running_mcqv4src = self.brctlcmd.get_mcqv4src(bridgename)
if running_mcqv4src:
r_mcqv4src = running_mcqv4src.get(vlan)
@@ -137,9 +138,9 @@ class bridgevlan(moduleBase):
def _init_command_handlers(self):
if not self.ipcmd:
self.ipcmd = iproute2(**self.get_flags())
self.ipcmd = iproute2()
if not self.brctlcmd:
self.brctlcmd = brctl(**self.get_flags())
self.brctlcmd = brctl()
def run(self, ifaceobj, operation, query_ifaceobj=None, **extra_args):
""" run vlan configuration on the interface object passed as argument