From 28a12e8b279eb3164e0581049165ea0fd8e4d807 Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Fri, 9 Dec 2016 22:35:55 +0000 Subject: [PATCH] Use dbus only if it is present (#19060) --- lib/ansible/modules/network/nmcli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/nmcli.py b/lib/ansible/modules/network/nmcli.py index 86a844c7ee..3571c9a77d 100644 --- a/lib/ansible/modules/network/nmcli.py +++ b/lib/ansible/modules/network/nmcli.py @@ -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",