Changeset 1098

Show
Ignore:
Timestamp:
01/30/2012 10:09:59 AM (4 months ago)
Author:
jlaine
Message:

capture stderr

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/boxadmin/host.py

    r1090 r1098  
    117117            cmd = "sudo %s" % cmd 
    118118        popen_args = self._ssh_command([self.host, cmd]) 
    119         p = subprocess.Popen(popen_args, stdout=subprocess.PIPE) 
    120         out = p.communicate()[0] 
     119        p = subprocess.Popen(popen_args, stderr=subprocess.PIPE, stdout=subprocess.PIPE) 
     120        out, err = p.communicate() 
     121        for line in err.splitlines(): 
     122            self.info(line) 
    121123        if p.wait(): 
    122124            raise HostError("Could not run %s" % cmd)