Merge pull request #465 from subutux/fix-vpn-with-spaces
Quote vpn names when executing nmcli
This commit is contained in:
commit
9ec8107be4
1 changed files with 4 additions and 2 deletions
|
@ -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")
|
||||||
|
|
Loading…
Reference in a new issue