From 469c0ab91ae550945eb4d0a18ebd284994fde384 Mon Sep 17 00:00:00 2001 From: Pierre Blanc Date: Wed, 2 Nov 2016 08:55:54 -0400 Subject: Add support for ethtool_opts option This patch add an optional option to specify the ETHTOOL_OPTS for each interface. ETHTOOL_OPTS option will be written to the ifcfg file. Change-Id: I6b594e89ba6b4c17e8df79def997f6c9ea427a3a --- os_net_config/impl_ifcfg.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'os_net_config/impl_ifcfg.py') diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py index 4a4caaa..e8dbd46 100644 --- a/os_net_config/impl_ifcfg.py +++ b/os_net_config/impl_ifcfg.py @@ -113,6 +113,8 @@ class IfcfgNetConfig(os_net_config.NetConfig): data += "TYPE=NFVSWITCHIntPort\n" elif isinstance(base_opt, objects.IbInterface): data += "TYPE=Infiniband\n" + if base_opt.ethtool_opts: + data += "ETHTOOL_OPTS=\"%s\"\n" % base_opt.ethtool_opts elif re.match('\w+\.\d+$', base_opt.name): data += "VLAN=yes\n" if base_opt.linux_bond_name: @@ -262,6 +264,9 @@ class IfcfgNetConfig(os_net_config.NetConfig): data += "BOOTPROTO=dhcp\n" elif not base_opt.addresses: data += "BOOTPROTO=none\n" + if isinstance(base_opt, objects.Interface): + if base_opt.ethtool_opts: + data += "ETHTOOL_OPTS=\"%s\"\n" % base_opt.ethtool_opts if base_opt.mtu: data += "MTU=%i\n" % base_opt.mtu -- cgit 1.2.3-korg