diff options
author | Dan Sneddon <dsneddon@redhat.com> | 2015-09-02 17:07:48 -0700 |
---|---|---|
committer | Dan Sneddon <dsneddon@redhat.com> | 2015-10-12 11:03:25 -0700 |
commit | d01acefc15cebcfc5b7d808d3ed4f41cbaf8d74d (patch) | |
tree | 36611573e6a153f6562d9b28a706d22915547bea /os_net_config/__init__.py | |
parent | 62bc734ad540cde0cf47b863db686b328d575d33 (diff) |
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
Diffstat (limited to 'os_net_config/__init__.py')
-rw-r--r-- | os_net_config/__init__.py | 11 |
1 files changed, 11 insertions, 0 deletions
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. |