try:
from urllib import pathname2url
-except:
+except Exception:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
)
try:
self.l3_intf_arp_accept = int(l3_intf_arp_accept_str)
- except:
+ except ValueError:
self.l3_intf_arp_accept = int(strtobool(l3_intf_arp_accept_str))
- except:
+ except Exception:
self.l3_intf_arp_accept = 0
self.l3_intf_default_gateway_set_onlink = utils.get_boolean_from_string(
try:
if utils.mac_str_to_int(old_mac_addr) != utils.mac_str_to_int(hwaddress):
self.iproute2.bridge_fdb_del(bridgename, old_mac_addr, vlan)
- except:
+ except Exception:
pass
if up:
# check statemanager to delete the old entry if necessary
for s in removed_slave:
try:
runningslaves.remove(s)
- except:
+ except Exception:
pass
return runningslaves
try:
iface_attrs.remove("es-sys-mac")
self.logger.info("%s: non-root user can't check attribute \"es-sys-mac\" value" % ifaceobj.name)
- except:
+ except Exception:
pass
for attr in iface_attrs:
module_name=self.__class__.__name__,
attr="bridge_vni_per_svi_limit"
))
- except:
+ except Exception:
self.bridge_vni_per_svi_limit = -1
@staticmethod
for obj in ifaceobj_getfunc(intf):
if obj.link_kind & ifaceLinkKind.BRIDGE:
return obj.name
- except:
+ except Exception:
pass
return None
for vlan_vni_map_entry in bridge_vlan_vni_map_entry.split():
try:
vlans_str, vni_str = utils.get_vlan_vni_in_map_entry(vlan_vni_map_entry)
- except:
+ except Exception:
return self.__warn_bridge_vlan_vni_map_syntax_error(vxlan_name, vlan_vni_map_entry)
# we need to convert vlan_str and vni_str back to a map {vlan: vni}
for vlan_vni in bridge_vlan_vni_map_entry.split():
try:
vlans_str, vni_str = utils.get_vlan_vni_in_map_entry(vlan_vni)
- except:
+ except Exception:
fail = True
self.__warn_bridge_vlan_vni_map_syntax_error(ifname, vlan_vni)
continue
if vlan != cached_vnis[index] or vnis_list[i] != cached_vlans[index]:
fail = True
- except:
+ except Exception:
fail = True
ifaceobjcurr.update_config_with_status("bridge-vlan-vni-map", bridge_vlan_vni_map_entry, fail)
try:
if self._get_vlan_id(ifaceobj) != -1:
return True
- except:
+ except Exception:
pass
return False
for vni, ip in (vxlan_mcast_grp_map or {}).items():
try:
old_vxlan_remote_ip_map[vni].remove(ip)
- except:
+ except Exception:
pass
for vni, ips in old_vxlan_remote_ip_map.items():
for ip in ips:
try:
self.iproute2.bridge_fdb_del_raw(ifaceobj.name, "00:00:00:00:00:00 dst %s src_vni %s" % (ip, vni))
- except:
+ except Exception:
pass
@staticmethod
try:
props = node_or_link['properties']
return props[key]
- except:
+ except Exception:
return None
def propertyRemove(self, node_or_link, key):
try:
from ifupdown2.ifupdown.utils import utils
-except:
+except ImportError:
from ifupdown.utils import utils
try:
directory_to_remove = "%s/%s%s_%s" % (self.LOGGING_DIRECTORY, self.LOGGING_DIRECTORY_PREFIX, ifupdown2_log_dirs[index][0], ifupdown2_log_dirs[index][1])
shutil.rmtree(directory_to_remove, ignore_errors=True)
- except:
+ except Exception:
pass
@staticmethod
def ip_address(ip):
try:
return IPv4Address(ip)
- except:
+ except Exception:
return IPv6Address(ip)
print (''' ifupdown2 addon modules add incremental functionality to
core ifupdown2 tool.
-
+
All installed addon modules are executed on every interface
listed in the interfaces file. Addon modules are installed under
/usr/share/ifupdownaddons. To see the list of active addon
try:
m = __import__(mname)
mclass = getattr(m, mname)
- except:
+ except Exception:
pass
continue
minstance = mclass()
if hasattr(minstance, 'get_modinfo'):
modinfo[mname] = minstance.get_modinfo()
- except:
+ except Exception:
raise
return modinfo
pos = int(args.position)
if pos < 0 or pos > len(addon_config.get(op)):
raise Exception('invalid value for position')
- except:
+ except Exception:
raise
if addon_config[op].index(module) == pos: