[et-mgmt-tools] [PATCH]: Print a better error message if the disk path doesn't exist
Chris Lalancette
clalance at redhat.com
Thu Oct 4 18:48:16 UTC 2007
Cole Robinson wrote:
> Hi Chris,
>
> Actually just yesterday I committed some validation cases to virtinst which
> catch this problem, though in a different location.
>
> http://hg.et.redhat.com/virt/applications/virtinst--devel?cs=c0b20d1eaaf2
>
> It catches it prior to the setup() portion of the code: when
> the disk path is passed to the VirtualDisk constructor, it now checks
> to ensure the directory exists, and if not throws a ValueError. This
> way virt-install can catch this and recover, then prompt the user for
> a corrected path.
>
> Not sure if the relevant portion of that patch fits your needs
> though.
>
Ah, it mostly does. Actually, I think my patch complements your patch. The
problem is that it could be the case that *after* your check, but before the
os.open(), the directory could be deleted, so you would still run into the
traceback. Unlikely, I know, but still possible, so I think my patch is still
worthwhile.
Thanks,
Chris Lalancette
More information about the et-mgmt-tools
mailing list