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

addons: ethtool: replacing loopback ipcmd check with private LOOPBACK flag

Ticket: CM-13737
Reviewed By: Roopa, Nikhil G
Testing Done:

Incremental commit for CM-13737

Create a policy file such as:

$ cat /var/lib/ifupdown2/policy.d/defaults_policy.json
{
    "README": "This file is automatically generated. Do not edit this file.",
    "ethtool": {
    	       "defaults": {
	       		   "link-autoneg": "off",
			   "link-duplex": "full",
			   "link-speed": "1000"
		},
		"iface_defaults": {}
    }
}

then do ifdown lo && ifup lo

without this patch or af8734d18a
you would reproduce the fail

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2016-12-02 06:21:35 +01:00
parent 736e4b0d17
commit 6ceda69ef0

View File

@@ -350,14 +350,13 @@ class ethtool(moduleBase,utilsBase):
of interfaces. status is success if the running state is same
as user required state in ifaceobj. error otherwise.
"""
if ifaceobj.link_kind:
if (ifaceobj.link_kind or
ifaceobj.link_privflags & ifaceLinkPrivFlags.LOOPBACK):
return
op_handler = self._run_ops.get(operation)
if not op_handler:
return
self._init_command_handlers()
if self.ipcmd.link_isloopback(ifaceobj.name):
return
if operation == 'query-checkcurr':
op_handler(self, ifaceobj, query_ifaceobj)
else: