~oreilldf/wicd/resolvconf2

« back to all changes in this revision

Viewing changes to wicd/misc.py

  • Committer: Dan O'Reilly
  • Date: 2009-03-09 04:07:39 UTC
  • Revision ID: oreilldf@gmail.com-20090309040739-dbhurh8jkls291by
Add support for using resolvconf instead of directly editing resolv.conf if possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
    else:
96
96
        err = None
97
97
        fds = False
 
98
    if return_obj:
 
99
        std_in = PIPE
 
100
    else:
 
101
        std_in = None
98
102
    
99
103
    # We need to make sure that the results of the command we run
100
104
    # are in English, so we set up a temporary environment.
105
109
    tmpenv["LANG"] = __LANG
106
110
    
107
111
    try:
108
 
        f = Popen(cmd, shell=False, stdout=PIPE, stderr=err, close_fds=fds,
109
 
                  cwd='/', env=tmpenv)
 
112
        f = Popen(cmd, shell=False, stdout=PIPE, stdin=std_in, stderr=err,
 
113
                  close_fds=fds, cwd='/', env=tmpenv)
110
114
    except OSError, e:
111
115
        print "Running command %s failed: %s" % (str(cmd), str(e))
112
116
        return ""