py2.7c: fix networkmanager connector on non-zero status
parent
a330e76846
commit
320c29c6b3
|
@ -10,7 +10,10 @@ class NetworkManagerConnector:
|
||||||
NMCLI_BASE = ["nmcli", "--mode", "tabular", "--terse", "--colors", "no"]
|
NMCLI_BASE = ["nmcli", "--mode", "tabular", "--terse", "--colors", "no"]
|
||||||
|
|
||||||
def _call_nmcli(self, args, parse=True):
|
def _call_nmcli(self, args, parse=True):
|
||||||
subp = subprocess.check_output(self.NMCLI_BASE + args).decode("utf-8")
|
try:
|
||||||
|
subp = subprocess.check_output(self.NMCLI_BASE + args).decode("utf-8")
|
||||||
|
except subprocess.CalledProcessError as err:
|
||||||
|
subp = err.output
|
||||||
|
|
||||||
if parse:
|
if parse:
|
||||||
# if no output
|
# if no output
|
||||||
|
|
Loading…
Reference in New Issue