mirror of
				https://github.com/CumulusNetworks/ifupdown2.git
				synced 2024-05-06 15:54:50 +00:00 
			
		
		
		
	addons: bridge/bond: fix ifquery regression where glob and regexes weren't expanded
Ticket:
Reviewed By: Roopa, Nikhil G
Testing Done:
auto br0
iface br0
      bridge-ports tap17 glob tap[2-4].100 tap19 regex tap2.*
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
			
			
This commit is contained in:
		| @@ -361,6 +361,11 @@ class bond(moduleBase): | |||||||
|                 difference = set(slaves).symmetric_difference(runningslaves) |                 difference = set(slaves).symmetric_difference(runningslaves) | ||||||
|                 if not difference: |                 if not difference: | ||||||
|                     retslave = 0 |                     retslave = 0 | ||||||
|  |         # we want to display the same bond-slaves list as provided | ||||||
|  |         # in the interfaces file but if this list contains regexes or | ||||||
|  |         # globs, for now, we won't try to change it. | ||||||
|  |         if 'regex' in slaves or 'glob' in slaves: | ||||||
|  |             slaves = runningslaves | ||||||
|         ifaceobjcurr.update_config_with_status('bond-slaves', |         ifaceobjcurr.update_config_with_status('bond-slaves', | ||||||
|                         ' '.join(slaves) |                         ' '.join(slaves) | ||||||
|                         if slaves else 'None', retslave) |                         if slaves else 'None', retslave) | ||||||
|   | |||||||
| @@ -1385,8 +1385,11 @@ class bridge(moduleBase): | |||||||
|         ports = None |         ports = None | ||||||
|         skip_kernel_stp_attrs = 0 |         skip_kernel_stp_attrs = 0 | ||||||
|  |  | ||||||
|  |         try: | ||||||
|             if self.systcl_get_net_bridge_stp_user_space() == '1': |             if self.systcl_get_net_bridge_stp_user_space() == '1': | ||||||
|                 userspace_stp = 1 |                 userspace_stp = 1 | ||||||
|  |         except Exception as e: | ||||||
|  |             self.logger.info('%s: %s' % (ifaceobjrunning.name, str(e))) | ||||||
|  |  | ||||||
|         tmpbridgeattrdict = self.brctlcmd.get_bridge_attrs(ifaceobjrunning.name) |         tmpbridgeattrdict = self.brctlcmd.get_bridge_attrs(ifaceobjrunning.name) | ||||||
|         if not tmpbridgeattrdict: |         if not tmpbridgeattrdict: | ||||||
| @@ -1615,10 +1618,13 @@ class bridge(moduleBase): | |||||||
|                                  ).symmetric_difference(bridge_port_list) |                                  ).symmetric_difference(bridge_port_list) | ||||||
|                   if not difference: |                   if not difference: | ||||||
|                      portliststatus = 0 |                      portliststatus = 0 | ||||||
|                   # we want to display the same bridge-ports list as provided |  | ||||||
|                   # in the interfaces file. |  | ||||||
|                   try: |                   try: | ||||||
|                     port_list = self._get_ifaceobj_bridge_ports(ifaceobj).split() |                     port_list = self._get_ifaceobj_bridge_ports(ifaceobj).split() | ||||||
|  |                     # we want to display the same bridge-ports list as provided | ||||||
|  |                     # in the interfaces file but if this list contains regexes or | ||||||
|  |                     # globs, for now, we won't try to change it. | ||||||
|  |                     if 'regex' in port_list or 'glob' in port_list: | ||||||
|  |                         port_list = running_port_list | ||||||
|                   except: |                   except: | ||||||
|                     port_list = running_port_list |                     port_list = running_port_list | ||||||
|                   ifaceobjcurr.update_config_with_status('bridge-ports', |                   ifaceobjcurr.update_config_with_status('bridge-ports', | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user