ia64/xen-unstable

changeset 14738:610dcfb3c164

Send INTERNAL_ERROR rather than ERROR_TODO if device creation fails.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Wed Apr 04 14:53:52 2007 +0100 (2007-04-04)
parents e5931b5e6cc5
children 4de1e743a5a8
files tools/python/xen/xend/XendAPI.py
line diff
     1.1 --- a/tools/python/xen/xend/XendAPI.py	Wed Apr 04 14:49:38 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendAPI.py	Wed Apr 04 14:53:52 2007 +0100
     1.3 @@ -2079,8 +2079,8 @@ class XendAPI(object):
     1.4              vif_ref = dom.create_vif(vif_struct)
     1.5              xendom.managed_config_save(dom)
     1.6              return xen_api_success(vif_ref)
     1.7 -        except XendError:
     1.8 -            return xen_api_error(XEND_ERROR_TODO)
     1.9 +        except XendError, exn:
    1.10 +            return xen_api_error(['INTERNAL_ERROR', str(exn)])
    1.11            
    1.12      def VIF_destroy(self, session, vif_ref):
    1.13          xendom = XendDomain.instance()
    1.14 @@ -2367,8 +2367,8 @@ class XendAPI(object):
    1.15                  vtpm_ref = dom.create_vtpm(vtpm_struct)
    1.16                  xendom.managed_config_save(dom)
    1.17                  return xen_api_success(vtpm_ref)
    1.18 -            except XendError:
    1.19 -                return xen_api_error(XEND_ERROR_TODO)
    1.20 +            except XendError, exn:
    1.21 +                return xen_api_error(['INTERNAL_ERROR', str(exn)])
    1.22          else:
    1.23              return xen_api_error(['HANDLE_INVALID', 'VM', vtpm_struct['VM']])
    1.24  
    1.25 @@ -2442,8 +2442,8 @@ class XendAPI(object):
    1.26              console_ref = dom.create_console(console_struct)
    1.27              xendom.managed_config_save(dom)
    1.28              return xen_api_success(console_ref)
    1.29 -        except XendError, e:
    1.30 -            return xen_api_error([XEND_ERROR_TODO, str(e)])
    1.31 +        except XendError, exn:
    1.32 +            return xen_api_error(['INTERNAL_ERROR', str(exn)])
    1.33  
    1.34      # Xen API: Class SR
    1.35      # ----------------------------------------------------------------