tools: xend: fix wrong condition check for xml file
authorJoe Jin <joe.jin@oracle.com>
Thu, 18 Oct 2012 08:35:08 +0000 (09:35 +0100)
committerJoe Jin <joe.jin@oracle.com>
Thu, 18 Oct 2012 08:35:08 +0000 (09:35 +0100)
In commit e8d40584, it intended to check xml file size and when empty will
return, the condition should be "if os.path.getsize(xml_path) == 0" rather
then "if not os.path.getsize(xml_path) == 0".

Signed-off-by: Chuang Cao <chuang.cao@oracle.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/python/xen/xend/XendStateStore.py

index 17a29f180e751a432ca8bed234c8a7cf7cb50256..a66181d1d48e45e5198150cfeccc9561594e0e97 100644 (file)
@@ -101,7 +101,7 @@ class XendStateStore:
         if not os.path.exists(xml_path):
             return {}
 
-        if not os.path.getsize(xml_path) == 0:
+        if os.path.getsize(xml_path) == 0:
             return {}
 
         dom = minidom.parse(xml_path)