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

ifupdownaddons: iproute2: fix set_mtu api to return if --no-act (DRYRUN) is set

Ticket: CM-10965
Reviewed By: julien
Testing Done: Tested set mtu with dry run

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This commit is contained in:
Roopa Prabhu
2016-05-15 13:49:05 -07:00
parent d2b357167d
commit 84414544de

View File

@@ -419,8 +419,9 @@ class iproute2(utilsBase):
self._cache_update([ifacename, 'hwaddress'], hwaddress)
def link_set_mtu(self, ifacename, mtu):
if ifupdownflags.flags.DRYRUN:
return True
if not mtu or not ifacename: return
with open('/sys/class/net/%s/mtu' % ifacename, 'w') as f:
f.write(mtu)
self._cache_update([ifacename, 'mtu'], mtu)