On Fri, Aug 12, 2011 at 10:22 AM, Iustin Pop <[email protected]> wrote:

> On Fri, Aug 12, 2011 at 09:41:37AM -0400, Ben Lipton wrote:
> > Now, fix_fstab uses the same algorithm to decide what drive to use - it
> > takes the first one found of /dev/xvda, /dev/vda, and /dev/sda.
> >
> > Also, fix a docstring.
>
> LGTM. I'm going to commit this as-is (due to 0.1), but FYI this can be
> done entirely in Python:
>
> > +  for hd in ["/dev/xvda", "/dev/vda", "/dev/sda"]:
> > +    status = subprocess.call(["test", "-b", hd])
> > +    if status == 0:
> > +      return hd
> > +  raise FixError("Could not locate a hard drive.")
>
> via os.stat and then testing st_mode.
>

Ah, true. When I did this in the previous patch I was doing it over ssh, and
then I mentally did something along the lines of s/subprocess/client/g
without really thinking about better ways.

>
> thanks,
> iustin
>

Reply via email to