- p = subprocess.Popen(cmd,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- close_fds=True)
- outdata,errdata = p.communicate()
- err = p.wait()
- except OSError, message:
- raise RuntimeError, "%s subprocess error:\n %s" % \
- (command, str(message))
- if err != 0:
- # Doesn't exist
- return False
+ outdata,errdata = util.run_command(cmd)
+ except RuntimeError, message:
+ raise RuntimeError, str(message)