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

networkinterfaces: fix is_keyword to not match attribute names with keywords in them

Ticket: CM-8729
Reviewed By: Nikhil
Testing Done: Tested with vlan device with vlan-raw-device in interfaces
file

also reported here: https://github.com/CumulusNetworks/ifupdown2/issues/10

is_keyword was matching iface attribute 'vlan-raw-device' to the vlan
keyword and dropping it from ifaceobj config.
This commit is contained in:
Roopa Prabhu
2016-02-29 23:04:08 -08:00
parent ccbeedcdf5
commit 3d58f6afc1

View File

@@ -336,8 +336,8 @@ class networkInterfaces():
def _is_keyword(self, str):
# The additional split here is for allow- keyword
tmp_str = str.split('-')[0]
if tmp_str in self.network_elems.keys():
if (str in self.network_elems.keys() or
str.split('-')[0] == 'allow'):
return 1
return 0