WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XEND] Fix Xen API attribute access to be

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Fix Xen API attribute access to be robust to missing keys.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 30 Nov 2006 21:30:34 +0000
Delivery-date: Thu, 30 Nov 2006 13:31:20 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alastair Tse <atse@xxxxxxxxxxxxx>
# Node ID b2f5f1251330aca85644c38f5864b716f68565be
# Parent  d9b5e34c4e5c45ae6f18beed4d2fafe5304182d8
[XEND] Fix Xen API attribute access to be robust to missing keys.

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff -r d9b5e34c4e5c -r b2f5f1251330 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Thu Nov 30 14:51:46 2006 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Thu Nov 30 14:53:14 2006 +0000
@@ -1742,13 +1742,13 @@ class XendDomainInfo:
         return dom_uuid
     
     def get_memory_static_max(self):
-        return self.info['memory_static_max']
+        return self.info.get('memory_static_max')
     def get_memory_static_min(self):
-        return self.info['memory_static_min']
+        return self.info.get('memory_static_min')
     def get_memory_dynamic_max(self):
-        return self.info['memory_dynamic_min']
+        return self.info.get('memory_dynamic_min')
     def get_memory_dynamic_min(self):
-        return self.info['memory_static_min']
+        return self.info.get('memory_dynamic_max')
     
     
     def get_vcpus_policy(self):
@@ -1766,27 +1766,29 @@ class XendDomainInfo:
     def get_bios_boot(self):
         return '' # TODO
     def get_platform_std_vga(self):
-        return False
+        return self.info.get('platform_std_vga', 0)    
     def get_platform_keymap(self):
         return ''
     def get_platform_serial(self):
-        return self.info['platform_serial']
+        return self.info.get('platform_serial', '')
     def get_platform_localtime(self):
-        return self.info['platform_localtime']
+        return self.info.get('platform_localtime', 0)
     def get_platform_clock_offset(self):
-        return self.info['platform_clock_offset']
+        return self.info.get('platform_clock_offset', 0)
     def get_platform_enable_audio(self):
-        return self.info['platform_enable_audio']
+        return self.info.get('platform_enable_audio', 0)
+    def get_platform_keymap(self):
+        return self.info.get('platform_keymap', '')
     def get_builder(self):
-        return self.info['builder']
+        return self.info.get('builder', 0)
     def get_boot_method(self):
-        return self.info['boot_method']
+        return self.info.get('boot_method', '')
     def get_kernel_image(self):
-        return self.info['kernel_kernel']
+        return self.info.get('kernel_kernel', '')
     def get_kernel_initrd(self):
-        return self.info['kernel_initrd']
+        return self.info.get('kernel_initrd', '')
     def get_kernel_args(self):
-        return self.info['kernel_args']
+        return self.info.get('kernel_args', '')
     def get_grub_cmdline(self):
         return '' # TODO
     def get_pci_bus(self):

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEND] Fix Xen API attribute access to be robust to missing keys., Xen patchbot-unstable <=