Chris Lalancette wrote: > 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 One gripe: > + except OSError: > + raise RuntimeError, "Path to diskimage "+self.path+" does not exist" This error message is too general, as it doesn't take into account non-missing-path related errors, so this could swallow another legitimate error message. - Cole -- Cole Robinson crobinso@xxxxxxxxxx _______________________________________________ et-mgmt-tools mailing list et-mgmt-tools@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/et-mgmt-tools