From d01acefc15cebcfc5b7d808d3ed4f41cbaf8d74d Mon Sep 17 00:00:00 2001 From: Dan Sneddon Date: Wed, 2 Sep 2015 17:07:48 -0700 Subject: Add Linux Bridge capability to os-net-config ifcfg This patch adds support for Linux Bridges to os-net-config. This is done completely with ifcfg files, brctl is not used directly. Hierarchy is preserved, so a Linux Bridge may have a Linux Bond as a member, which in turn may have multiple interfaces as members. This changeset has been updated to include a more specific example for Linux bridge configuration (that doesn't combine bridging and bonding). This change depends on the change to add support for Linux Bonds. Change-Id: I1ddacd514b02af30139a868071d82cde19b1f946 --- os_net_config/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'os_net_config/__init__.py') diff --git a/os_net_config/__init__.py b/os_net_config/__init__.py index 489b27a..42131bb 100644 --- a/os_net_config/__init__.py +++ b/os_net_config/__init__.py @@ -52,6 +52,10 @@ class NetConfig(object): self.add_bridge(obj) for member in obj.members: self.add_object(member) + elif isinstance(obj, objects.LinuxBridge): + self.add_linux_bridge(obj) + for member in obj.members: + self.add_object(member) elif isinstance(obj, objects.OvsBond): self.add_bond(obj) for member in obj.members: @@ -82,6 +86,13 @@ class NetConfig(object): """ raise NotImplemented("add_bridge is not implemented.") + def add_linux_bridge(self, bridge): + """Add a LinuxBridge object to the net config object. + + :param bridge: The LinuxBridge object to add. + """ + raise NotImplemented("add_linux_bridge is not implemented.") + def add_bond(self, bond): """Add an OvsBond object to the net config object. -- cgit 1.2.3-korg