[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [et-mgmt-tools] [PATCH] virtinst - virt-convert vmware output



Yep that's why I returned as false, if we log it, it will need to be "not recognized as a virt-image file, continuing...." or similiar


John Levon wrote:
On Tue, Sep 30, 2008 at 01:19:57PM -0400, Cole Robinson wrote:

     @staticmethod
     def identify_file(input_file):
         """
         Return True if the given file is of this format.
         """
-        raise NotImplementedError
+        try:
+            image = ImageParser.parse_file(input_file)
+        except ImageParser.ParserException, msg:
+            return False
Please log the failure here.

Actually, I think this is right - we try multiple identify_file()
routines until we find a sucessful one.

Perhaps this code could split out "I know this is a virt-image file"
from "I failed to parse this virt-image file", but I'm not sure it's
worth it.

regards
john


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]