From 78e1b65d93a1c16d58fd72cb65f8e2adf1762854 Mon Sep 17 00:00:00 2001 From: Dan Sneddon Date: Wed, 13 Apr 2016 01:17:16 -0700 Subject: Add support for Infiniband interfaces This patch adds support for Infiniband interfaces. The only difference between Inifiniband and regular interfaces at this time is that an interface with type "ib_interface" will have "TYPE=Infiniband" added to the ifcfg file. However, the Infiniband interface is implemented as a full new class, so in the future we can add script functions or additional config options to the Infiniband interface config if needed. Unit tests for both the object and the ifcfg implementation are included. This patch does not include an implementation for systems that use /etc/network/interfaces (Debian-based systems). Note that this change has not yet been tested on bare metal with Infiniband hardware. Fixes bug: https://bugzilla.redhat.com/show_bug.cgi?id=1326616 Change-Id: Iaeaca9cd71e2cea6147951d49aecc7458be4ca0b --- os_net_config/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'os_net_config/__init__.py') diff --git a/os_net_config/__init__.py b/os_net_config/__init__.py index 88e8900..fc1a38a 100644 --- a/os_net_config/__init__.py +++ b/os_net_config/__init__.py @@ -75,6 +75,8 @@ class NetConfig(object): self.add_ovs_tunnel(obj) elif isinstance(obj, objects.OvsPatchPort): self.add_ovs_patch_port(obj) + elif isinstance(obj, objects.IbInterface): + self.add_ib_interface(obj) def add_interface(self, interface): """Add an Interface object to the net config object. @@ -139,6 +141,13 @@ class NetConfig(object): """ raise NotImplemented("add_ovs_patch_port is not implemented.") + def add_ib_interface(self, ib_interface): + """Add an InfiniBand Interface object to the net config object. + + :param interface: The InfiniBand Interface object to add. + """ + raise NotImplemented("add_ib_interface is not implemented.") + def apply(self, cleanup=False): """Apply the network configuration. -- cgit 1.2.3-korg