static wired conn. doesn't write /etc/resolv.conf

Bug #181031 reported by Troy Cauble
2
Affects Status Importance Assigned to Milestone
wicd
Fix Released
High
Dan O'Reilly

Bug Description

Version 1.4.1. Kubuntu Gutsy.

Using a static wired connection, wicd *still* doesn't write /etc/resolv.conf.
It's been many releases since this worked.

Revision history for this message
Troy Cauble (troycauble) wrote :

In the log I see

2008/01/07 10:07:49 :: Use static DNS: True
2008/01/07 10:07:49 :: Use global DNS: None

This is printed just before the associated code does a lot of True/False checks.
Does False == None in python?

-troy

Revision history for this message
Troy Cauble (troycauble) wrote :

Also the related code is testing strings against booleans.

I changed

            if (network.get('use_static_dns') == True and
                network.get('use_global_dns') == False):

to

            if (bool(network.get('use_static_dns')) == True and
                bool(network.get('use_global_dns')) == False):

for one block and got the block to execute.
Or you could use "True" and "False" with quotes.

Revision history for this message
Dan O'Reilly (oreilldf) wrote :

Thanks for the report and fix. Would you mind changing the lines you changed back, and add these two lines to the ReadWiredNetworkProfile method:
            profile['use_global_dns'] = bool(profile['use_global_dns'])
            profile['use_static_dns'] = bool(profile['use_static_dns'])
So that it looks like this:
        if config.has_section(profilename) == True:
            for x in config.options(profilename):
                profile[x] = misc.Noneify(config.get(profilename,x))
            profile['use_global_dns'] = bool(profile['use_global_dns'])
            profile['use_static_dns'] = bool(profile['use_static_dns'])
            self.WiredNetwork = profile

Then restart everything and see if it still writes to /etc/resolv.conf? It should have the same effect as your change, it just does it right when the profile gets read into memory.

Also, yes, as you probably noticed, bool(None) == False in python.

Dan O'Reilly (oreilldf)
Changed in wicd:
assignee: nobody → oreilldf
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Troy Cauble (troycauble) wrote :

I had to change your lines to use 'profile.get'.

            profile['use_global_dns'] = bool(profile.get('use_global_dns'))
            profile['use_static_dns'] = bool(profile.get('use_static_dns'))

I was seeing exceptions when those keys didn't exist.

-troy

Revision history for this message
Troy Cauble (troycauble) wrote :

(Then everything worked.)

Revision history for this message
phys_user (myemail-slopsbox) wrote :

Same problem here, cabled does not write the /etc/resolv.conf. Debian lenny amd64, wicd 1.4.1.

Dan O'Reilly (oreilldf)
Changed in wicd:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.