def METHOD_NAME(cmd):
    # poor man's subprocess.check_output, not supported on SL6
    process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, stderr=subprocess.STDOUT)
    output, unused_err = process.communicate()
    retcode = process.poll()
    if retcode:
        raise Exception("Command {0} exited with code {1}. Output: {2}".format(cmd, retcode, output))
    return output