Use dbus only if it is present (#19060)

This commit is contained in:
Fabio Alessandro Locati 2016-12-09 22:35:55 +00:00 committed by John R Barker
parent 3b509b1095
commit 28a12e8b27

View file

@ -524,7 +524,8 @@ class Nmcli(object):
platform='Generic'
distribution=None
bus=dbus.SystemBus()
if HAVE_DBUS:
bus=dbus.SystemBus()
# The following is going to be used in dbus code
DEVTYPES={1: "Ethernet",
2: "Wi-Fi",