mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Properly gate dbus definitions
This commit is contained in:
parent
98cf9ab00a
commit
0ff4ef4cab
@ -25,20 +25,23 @@ except ImportError:
|
||||
|
||||
try:
|
||||
import dbus
|
||||
from dbus import DBusException
|
||||
BUS = dbus.SystemBus()
|
||||
SERVER = dbus.Interface(BUS.get_object(avahi.DBUS_NAME, avahi.DBUS_PATH_SERVER),
|
||||
avahi.DBUS_INTERFACE_SERVER)
|
||||
GROUP = dbus.Interface(BUS.get_object(avahi.DBUS_NAME, SERVER.EntryGroupNew()),
|
||||
avahi.DBUS_INTERFACE_ENTRY_GROUP)
|
||||
HAS_DBUS = True
|
||||
except ImportError:
|
||||
HAS_DBUS = False
|
||||
except DBusException:
|
||||
HAS_DBUS = False
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
__virtualname__ = 'avahi_announce'
|
||||
|
||||
LAST_GRAINS = {}
|
||||
BUS = dbus.SystemBus()
|
||||
SERVER = dbus.Interface(BUS.get_object(avahi.DBUS_NAME, avahi.DBUS_PATH_SERVER),
|
||||
avahi.DBUS_INTERFACE_SERVER)
|
||||
GROUP = dbus.Interface(BUS.get_object(avahi.DBUS_NAME, SERVER.EntryGroupNew()),
|
||||
avahi.DBUS_INTERFACE_ENTRY_GROUP)
|
||||
|
||||
|
||||
def __virtual__():
|
||||
|
Loading…
Reference in New Issue
Block a user