def run(cmd):
    print '[vendoring] Running command: %s' % ' '.join(cmd)
    try:
        result = subprocess.Popen(
            cmd,
            stderr=subprocess.PIPE,
            stdout=subprocess.PIPE
        )
    except Exception:
        # if building with python2.5 this makes it compatible
        _, error, _ = sys.exc_info()
        print_error([], traceback.format_exc(error).split('\n'))
        raise SystemExit(1)

    if result.wait():
        print_error(result.stdout.readlines(), result.stderr.readlines())

    return result.returncode
dataset/ETHPy150Open ceph/ceph-deploy/vendor.py/run/original