def execute_get_output(*command):
    devnull = open(os.devnull, 'w')
    command = map(str, command)
    proc = subprocess.Popen(command, close_fds=True,
                            stdout=subprocess.PIPE, stderr=devnull)
    devnull.close()
    stdout = proc.communicate()[0]
    return stdout.strip()
Execute and return stdout.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/plugins/xenserver/networking/etc/xensource/scripts/novalib.py/execute_get_output