在完成之前解析命令输出

时间:2015-12-07 14:36:54

标签: python fabric

我正在使用fabric处理部署,一步是升级debian软件包。我正在执行

sudo('aptitude install packagename')

它会问我:

[server] out: 1 packages upgraded, 0 newly installed, 0 to remove and 110 not upgraded.
[server] out: Need to get 40.7 kB of archives. After unpacking 1,024 B will be used.
[server] out: Do you want to continue? [Y/n/?]

我想确保正好有1个包升级,0个要删除。我正在尝试解析基于该规则的问题,但我无法弄清楚如何在命令执行完之前访问该文本。有办法吗?

0 个答案:

没有答案