vmdk_ops.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:vsphere-storage-for-docker 作者: vmware 项目源码 文件源码
def RunCommand(cmd):
    """RunCommand

   Runs command specified by user

   @param command to execute
   """
    logging.debug("Running cmd %s", cmd)

    p = subprocess.Popen(cmd,
                         stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE,
                         universal_newlines=True,
                         shell=True)
    o, e = p.communicate()
    s = p.returncode

    if s != 0:
        return (s, e)

    return (s, o)

# returns error, or None for OK
# opts is  dictionary of {option: value}.
# for now we care about size and (maybe) policy
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号