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.

thanks,
iustin

Reply via email to