Re: GetAccessPoints returning empty





On Wed, Feb 10, 2010 at 6:30 AM, Jirka Klimes <jklimes redhat com> wrote:
On Tuesday 09 of February 2010 18:57:37 Hugo Melo wrote:
> Hi guys,
> I've discovered that when I have a system settings service connection
> configured ( like ifcfg-AP and keys-AP ) and nm-applet is not running I get
> an empty list as a result of GetAccessPoints().
> Is this a bug?
> How can I workaround it?
> If I don't have those files on /etc/sysconfig/network-scripts or If I have
> nm-applet running the function returns the right list.
> Thanks!
>

Hi Jirka,
Thank you for your response.
Hmm, I don't face such behaviour.
How do you call GetAccessPoints(), using dbus-send or other program/script?
I've created my own script. See below.
 
Are the ifcfg-AP and keys-AP files correct? What does /var/log/messages say?
The only message I can see there regarding NetworkManager is:
 Feb 10 16:21:27 panini NetworkManager: supplicant_interface_acquire: assertion `mgr_state == NM_SUPPLICANT_MANAGER_STATE_IDLE' failed
...
Feb 10 16:27:24 panini NetworkManager: supplicant_interface_acquire: assertion `mgr_state == NM_SUPPLICANT_MANAGER_STATE_IDLE' failed


Empty list could mean that wireless is off. Check
/var/lib/NetworkManager/NetworkManager.state. How did you stop nm-applet?
 
[main]
NetworkingEnabled=true
WirelessEnabled=true
I just restarted my computer and logged in  in text mode.
I ran this code and got an empty dbus list.

Jirka


nm = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager')
devices = nm.GetDevices(dbus_interface='org.freedesktop.NetworkManager')

for path in devices:
 device = bus.get_object('org.freedesktop.NetworkManager', path)
 device_props = dbus.Interface(device, dbus_interface='org.freedesktop.DBus.Properties')
 props = device_props.GetAll("org.freedesktop.NetworkManager.Device")
 if props["DeviceType"] == NM_DEVICE_TYPE_802_11_WIRELESS:
    break

access = device.GetAccessPoints(dbus_interface='org.freedesktop.NetworkManager.Device.Wireless')
print str(access)

--
-- Hugo Melo


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]