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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user