Commit dc9124c5 authored by Julien Muchembled's avatar Julien Muchembled

Do not abort when UPnP fails to refresh port forwarding

parent f2b67235
...@@ -41,7 +41,12 @@ class Forwarder: ...@@ -41,7 +41,12 @@ class Forwarder:
def refresh(self): def refresh(self):
logging.debug('Refreshing port forwarding') logging.debug('Refreshing port forwarding')
for args in self._rules: for args in self._rules:
self._u.addportmapping(*args) try:
self._u.addportmapping(*args)
except Exception, e:
if str(e) != 'UnknownError':
raise
logging.warning("Failed to refresh port forwarding: %s", args)
self.next_refresh = time.time() + 500 self.next_refresh = time.time() + 500
def clear(self): def clear(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment