ia64/xen-unstable

changeset 19153:861ebefa7f39

XendAPIStore - do not remove non-existent item

If list is searched and item not found, then don't attempt to delete
the item.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Feb 04 11:57:17 2009 +0000 (2009-02-04)
parents c3b5e36248c9
children 3e1e87052029
files tools/python/xen/xend/XendAPIStore.py
line diff
     1.1 --- a/tools/python/xen/xend/XendAPIStore.py	Tue Feb 03 18:14:19 2009 +0000
     1.2 +++ b/tools/python/xen/xend/XendAPIStore.py	Wed Feb 04 11:57:17 2009 +0000
     1.3 @@ -33,7 +33,8 @@ def register(uuid, type, inst):
     1.4  
     1.5  def deregister(uuid, type):
     1.6      old = get(uuid, type)
     1.7 -    del __classes[(uuid, type)]
     1.8 +    if old is not None:
     1.9 +        del __classes[(uuid, type)]
    1.10      return old
    1.11  
    1.12  def get(uuid, type):