Merge pull request #465 from subutux/fix-vpn-with-spaces

Quote vpn names when executing nmcli
This commit is contained in:
tobi-wan-kenobi 2019-11-12 13:40:10 +01:00 committed by GitHub
commit 9ec8107be4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,7 +65,8 @@ class Module(bumblebee.engine.Module):
def _on_vpn_disconnect(self): def _on_vpn_disconnect(self):
try: try:
bumblebee.util.execute("nmcli c down " + self._connected_vpn_profile) bumblebee.util.execute("nmcli c down \"{vpn}\""
.format(vpn=self._connected_vpn_profile))
self._connected_vpn_profile = None self._connected_vpn_profile = None
except Exception as e: except Exception as e:
logging.exception("Couldn't disconnect VPN connection") logging.exception("Couldn't disconnect VPN connection")
@ -74,7 +75,8 @@ class Module(bumblebee.engine.Module):
self._selected_vpn_profile = name self._selected_vpn_profile = name
try: try:
bumblebee.util.execute("nmcli c up " + self._selected_vpn_profile) bumblebee.util.execute("nmcli c up \"{vpn}\""
.format(vpn=self._connected_vpn_profile))
self._connected_vpn_profile = name self._connected_vpn_profile = name
except Exception as e: except Exception as e:
logging.exception("Couldn't establish VPN connection") logging.exception("Couldn't establish VPN connection")