###--------------------------------------------------------------------------
### NetworkManager monitor.
+DBPROPS_IFACE = 'org.freedesktop.DBus.Properties'
+
NM_NAME = 'org.freedesktop.NetworkManager'
NM_PATH = '/org/freedesktop/NetworkManager'
NM_IFACE = NM_NAME
def attach(me, bus):
try:
nm = bus.get_object(NM_NAME, NM_PATH)
- state = nm.Get(NM_IFACE, 'State')
+ state = nm.Get(NM_IFACE, 'State', dbus_interface = DBPROPS_IFACE)
if state in NM_CONNSTATES:
netupdown(True, ['nm', 'initially-connected'])
else:
netupdown(False, ['nm', 'initially-disconnected'])
- except D.DBusException:
- pass
+ except D.DBusException, e:
+ if T._debug: print '# exception attaching to network-manager: %s' % e
bus.add_signal_receiver(me._nm_state, 'StateChanged',
NM_IFACE, NM_NAME, NM_PATH)
bus.add_signal_receiver(me._nm_connchange, 'PropertiesChanged',
props = cm.GetProperties(dbus_interface = CM_IFACE)
state = props['State']
netupdown(state == 'online', ['connman', 'initially-%s' % state])
- except D.DBusException:
- pass
+ except D.DBusException, e:
+ if T._debug: print '# exception attaching to connman: %s' % e
bus.add_signal_receiver(me._cm_state, 'PropertyChanged',
CM_IFACE, CM_NAME, CM_PATH)
except D.DBusException:
me._iap = None
netupdown(False, ['icd', 'initially-disconnected'])
- except D.DBusException:
+ except D.DBusException, e:
+ if T._debug: print '# exception attaching to icd: %s' % e
me._iap = None
bus.add_signal_receiver(me._icd_state, 'status_changed', ICD_IFACE,
ICD_NAME, ICD_PATH)