From c669f49d9fb55c655352a6b03fecb9fbb8669a96 Mon Sep 17 00:00:00 2001 From: Stijn Van Campenhout Date: Tue, 12 Nov 2019 11:04:29 +0100 Subject: [PATCH] Quote vpn names when executing nmcli --- bumblebee/modules/vpn.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/vpn.py b/bumblebee/modules/vpn.py index f02842e..7797614 100644 --- a/bumblebee/modules/vpn.py +++ b/bumblebee/modules/vpn.py @@ -65,7 +65,8 @@ class Module(bumblebee.engine.Module): def _on_vpn_disconnect(self): try: - bumblebee.util.execute("nmcli c down " + self._connected_vpn_profile) + bumblebee.util.execute("nmcli c down \"{vpn}\"" + .format(self._connected_vpn_profile)) self._connected_vpn_profile = None except Exception as e: logging.exception("Couldn't disconnect VPN connection") @@ -74,7 +75,8 @@ class Module(bumblebee.engine.Module): self._selected_vpn_profile = name try: - bumblebee.util.execute("nmcli c up " + self._selected_vpn_profile) + bumblebee.util.execute("nmcli c up \"{vpn}\"" + .format(self._connected_vpn_profile)) self._connected_vpn_profile = name except Exception as e: logging.exception("Couldn't establish VPN connection")