~ubuntu-branches/ubuntu/saucy/wicd/saucy-proposed

« back to all changes in this revision

Viewing changes to wicd/wicd-daemon.py

  • Committer: Package Import Robot
  • Author(s): David Paleino
  • Date: 2012-11-02 21:49:32 UTC
  • Revision ID: package-import@ubuntu.com-20121102214932-oiqjicfuxycdwd53
Tags: 1.7.2.4-3
* Fix debian/watch
* Recommend rfkill in wicd-daemon (Closes: #683559)
* Substitute dependency on dhcp3-client with isc-dhcp-client
  (Closes: #680976)
* Fix handling of /etc/resolv.conf when it's a symlink (Closes: #691973)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1703
1703
        # don't back up if .orig exists, probably there cause
1704
1704
        # wicd exploded
1705
1705
        if not os.path.exists(backup_location):
1706
 
            shutil.copy2('/etc/resolv.conf', backup_location)
 
1706
            if os.path.islink('/etc/resolv.conf'):
 
1707
                dest = os.readlink('/etc/resolv.conf')
 
1708
                os.symlink(dest, backup_location)
 
1709
            else:
 
1710
                shutil.copy2('/etc/resolv.conf', backup_location)
1707
1711
            os.chmod(backup_location, 0644)
1708
1712
    except IOError:
1709
1713
        print 'error backing up resolv.conf'
1750
1754
 
1751
1755
        # restore resolv.conf on quit
1752
1756
        try:
1753
 
            shutil.move(wpath.varlib + 'resolv.conf.orig', '/etc/resolv.conf')
 
1757
            backup_location = wpath.varlib + 'resolv.conf.orig'
 
1758
            if os.path.islink(backup_location):
 
1759
                dest = os.readlink(backup_location)
 
1760
                os.remove('/etc/resolv.conf')
 
1761
                os.symlink(dest, '/etc/resolv.conf')
 
1762
            else:
 
1763
                shutil.move(backup_location, '/etc/resolv.conf')
1754
1764
            os.chmod('/etc/resolv.conf', 0644)
1755
1765
        except IOError:
1756
1766
            print 'error restoring resolv.conf'