mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
firewall: fix upnpc.discover() behavior that somehow now trigger an exception when cant talk to upnp device
This commit is contained in:
parent
37eac5e121
commit
224f1b1730
1 changed files with 7 additions and 1 deletions
|
@ -402,7 +402,13 @@ def firewall_upnp(action="status", no_refresh=False):
|
|||
|
||||
# Discover UPnP device(s)
|
||||
logger.debug("discovering UPnP devices...")
|
||||
nb_dev = upnpc.discover()
|
||||
try:
|
||||
nb_dev = upnpc.discover()
|
||||
except Exception as e:
|
||||
logger.warning("Failed to find any UPnP device on the network")
|
||||
nb_dev = -1
|
||||
enabled = False
|
||||
|
||||
logger.debug("found %d UPnP device(s)", int(nb_dev))
|
||||
if nb_dev < 1:
|
||||
logger.error(m18n.n("upnp_dev_not_found"))
|
||||
|
|
Loading…
Add table
Reference in a new issue