Browse Source

* Added warning for #22

pull/29/head
Per-Arne Andersen 5 years ago
parent
commit
c273dff215
  1. 5
      wg_dashboard_backend/script/wireguard.py

5
wg_dashboard_backend/script/wireguard.py

@ -48,7 +48,7 @@ def _run_wg(server: schemas.WGServer, command):
return output return output
except Exception as e: except Exception as e:
if b'Operation not permitted' in e.output: if b'Operation not permitted' in e.output:
raise WGPermissionsError("The user has insufficientt permissions for interface %s" % server.interface) raise WGPermissionsError("The user has insufficient permissions for interface %s" % server.interface)
def is_installed(): def is_installed():
@ -109,6 +109,9 @@ def is_running(server: schemas.WGServer):
try: try:
output = _run_wg(server, ["show", server.interface]) output = _run_wg(server, ["show", server.interface])
if output is None or b'Unable to access interface: No such device' in output: if output is None or b'Unable to access interface: No such device' in output:
_LOGGER.warning("Unable to access interface: No such device. "
"This may indicate that there is a bug somewhere, "
"or that you have manually deleted parts of the database")
return False return False
except Exception as e: except Exception as e:
if b'No such device' in e.output: if b'No such device' in e.output:

Loading…
Cancel
Save