Code review comment for lp:~evfool/software-properties/lp1060192

Revision history for this message
Michael Vogt (mvo) wrote :

On Wed, Feb 13, 2013 at 03:24:18PM -0000, Robert Roth wrote:
> Robert Roth has proposed merging lp:~evfool/software-properties/lp1060192 into lp:software-properties.
>
> Commit message:
> - Do not use Shell=True unnecessarily in subprocess.Popen (bug #1060192)
[..]

Great! Thanks for working on this!

> self.parent.report_action("Pinging %s..." % host)
> - commando = subprocess.Popen("ping -q -c 2 -W 1 -i 0.5 %s" % host,
> - shell=True, stdout=subprocess.PIPE,
> + commando = subprocess.Popen(["ping", "-q", "-c 2", "-W 1", "-i 0.5", host],
> + stdout=subprocess.PIPE,
> stderr=subprocess.STDOUT,
> universal_newlines=True).stdout
> while True:

You can also go one step further and do ["ping", "-c", "2", "-W",
"1"...].

But ping is fine with both. Thanks again for getting rid of the
shell=True.

Cheers,
 Michael

« Back to merge proposal