def METHOD_NAME(cmdline):
    try:
        proc = subprocess.Popen(cmdline,
                                stdout=subprocess.PIPE,
                                stderr=subprocess.STDOUT,
                                universal_newlines=True)
        stdout = proc.communicate()[0]
        rc = proc.wait()
        result = stdout.rstrip('\n')
        if rc != 0:
            raise RuntimeError("Failed to execute command {}, return code {}, {}".format(cmdline, rc, stdout))
    except OSError as e:
        raise RuntimeError("Failed to execute command {} due to {}".format(cmdline, repr(e)))
    return result