install_venv_common.py 文件源码

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

项目:networking-huawei 作者: openstack 项目源码 文件源码
def run_command_with_code(self, cmd, redirect_output=True,
                              check_exit_code=True):
        """Runs a command in an out-of-process shell.

        Returns the output of that command. Working directory is self.root.
        """
        if redirect_output:
            stdout = subprocess.PIPE
        else:
            stdout = None

        proc = subprocess.Popen(cmd, cwd=self.root, stdout=stdout)
        output = proc.communicate()[0]
        if check_exit_code and proc.returncode != 0:
            self.die('Command "%s" failed.\n%s', ' '.join(cmd), output)
        return (output, proc.returncode)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号