def METHOD_NAME(cmd):
    p = popen2.Popen3(cmd, True)
    if (p.wait() != 0):
        raise Exception("Failed to execute command. Command: " + cmd + ", Error: " + p.childerr.read())
    return p.fromchild.read()