Skip to contentSkip to conversation

tools: xend: fix wrong condition check for xml file

PATCH Applied Joe Jin 3 participants 3 messages Oct 16, 2012 – Oct 18, 2012

lore
Share & tools
lore

Joe Jin

author
#0 lore raw

PATCH 1/1 tools: xend: fix wrong condition check for xml file

Hi Konrad,

Would you please review below fix?

Thanks,
Joe

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".

---
 tools/python/xen/xend/XendStateStore.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/python/xen/xend/XendStateStore.py +1 -1
index 17a29f1..a66181d 100644
@@ -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)
Signature · 1 line
1.7.11.7
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Joe Jin

Hi Konrad,

Would you please review below fix?

Quoted 30 lines

Thanks,
Joe

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".

---
 tools/python/xen/xend/XendStateStore.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/python/xen/xend/XendStateStore.py +1 -1
index 17a29f1..a66181d 100644
@@ -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)
Signature · 1 line
1.7.11.7
Applied
#2 lore raw
Quoted 6 lines · Konrad Rzeszutek Wilk
Quoted 3 lines · Joe Jin

Hi Konrad,

Would you please review below fix?

Applied, thanks.

Quoted 35 lines
Quoted 30 lines

Thanks,
Joe

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".

---
 tools/python/xen/xend/XendStateStore.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/python/xen/xend/XendStateStore.py +1 -1
index 17a29f1..a66181d 100644
@@ -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)
Signature · 1 line
1.7.11.7

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel