wicd-cli cannot connect to network

Bug #515045 reported by sub501 on 2010-01-31
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
wicd
Undecided
Unassigned

Bug Description

Hello there,

I'm trying to make use of wicd-cli and I have an error when -c switch is used:

wicd-cli -c --wireless
Traceback (most recent call last):
  File "/usr/share/wicd/cli/wicd-cli.py", line 197, in <module>
    while check():
NameError: name 'check' is not defined

As the doc is incomplete I really don't know if I used the right syntax. I also tried:

wicd-cli -c --wireless -m MY_WRL_SSID
Traceback (most recent call last):
  File "/usr/share/wicd/cli/wicd-cli.py", line 197, in <module>
    while check():
NameError: name 'check' is not defined

Thanks,
Sub

sub501 (sub501) wrote :

Sorry, forgot to mention the release version, it is 1.7.0.

Thanks,
Sub

Adam Blackburn (adamblackburn) wrote :

I just checked into this; it isn't a bug, it's operator error. However, I didn't know that without reading the code, so it's unlikely that anyone else would either. The correct usage in this case is

wicd-cli -c --wireless --network 0

where 0 is the number of the network you wish to connect to. Try that and let me know if it works. I'm going to work on updating/creating the documentation for wicd-cli.

Martin Fox (belden-fox) wrote :

Sorry to re-open this, but I believe this is a bug in the Python script. The problem occurs here

if options.connect:
    check = None
    if options.wireless and options.network > -1:
        is_valid_wireless_network_id(options.network)
        name = wireless.GetWirelessProperty(options.network, 'essid')
        encryption = wireless.GetWirelessProperty(options.network, 'enctype')

The third line should read simply "if options.wireless:" without checking for a valid network. That check should be done by is_valid_wireless_network_id() which is called on the next line; that function will generate an appropriate error message and exit the script.

sandwood (keysandwood) wrote :

in response to comment #3 :

I agree with this comment , and I tested it successfully.

I saw what might be another flow : what is the purpose of the
    else:
        check = lambda: False
        status = lambda: False
        message = lambda: False

? as the script previously check that one of these 2 options is chosen

if not (options.wireless or options.wired):
    print "Please use --wireless or --wired to specify " + \
    "the type of connection to operate on."

I believe this is some dead code.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers