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] Replace the X_HANDLE_INVALID error codes

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Replace the X_HANDLE_INVALID error codes with a single HANDLE_INVALID that
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 Feb 2007 19:30:12 -0800
Delivery-date: Tue, 20 Feb 2007 19:30:23 -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 Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1171985041 0
# Node ID 8bcd71c3b49550b5bb8461d530c8c5275634c975
# Parent  f65a24235f581dea2c2242f0b628d0caa6507341
Replace the X_HANDLE_INVALID error codes with a single HANDLE_INVALID that
names the class as a parameter.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 docs/xen-api/xenapi-datamodel.tex         |  134 +-----------------------------
 tools/python/xen/xend/XendAPI.py          |   79 ++++++++---------
 tools/python/xen/xm/messages/en/xen-xm.po |   42 ---------
 3 files changed, 50 insertions(+), 205 deletions(-)

diff -r f65a24235f58 -r 8bcd71c3b495 docs/xen-api/xenapi-datamodel.tex
--- a/docs/xen-api/xenapi-datamodel.tex Tue Feb 20 23:54:42 2007 +0000
+++ b/docs/xen-api/xenapi-datamodel.tex Tue Feb 20 15:24:01 2007 +0000
@@ -11767,34 +11767,15 @@ Each possible error code is documented i
 
 \subsection{Error Codes}
 
-\subsubsection{HOST\_CPU\_HANDLE\_INVALID}
-
-You gave an invalid host\_cpu handle.  The host\_cpu may have recently been
-deleted.  The handle parameter echoes the bad value given.
+\subsubsection{HANDLE\_INVALID}
+
+You gave an invalid handle.  The object may have recently been deleted. 
+The class parameter gives the type of reference given, and the handle
+parameter echoes the bad value given.
 
 \vspace{0.3cm}
 {\bf Signature:}
-\begin{verbatim}HOST_CPU_HANDLE_INVALID(handle)\end{verbatim}
-\begin{center}\rule{10em}{0.1pt}\end{center}
-
-\subsubsection{HOST\_HANDLE\_INVALID}
-
-You gave an invalid host handle.  The host may have recently been deleted. 
-The handle parameter echoes the bad value given.
-
-\vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}HOST_HANDLE_INVALID(handle)\end{verbatim}
-\begin{center}\rule{10em}{0.1pt}\end{center}
-
-\subsubsection{HOST\_METRICS\_HANDLE\_INVALID}
-
-You gave an invalid host\_metrics handle.  The host\_metrics may have
-recently been deleted.  The handle parameter echoes the bad value given.
-
-\vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}HOST_METRICS_HANDLE_INVALID(handle)\end{verbatim}
+\begin{verbatim}HANDLE_INVALID(class, handle)\end{verbatim}
 \begin{center}\rule{10em}{0.1pt}\end{center}
 
 \subsubsection{INTERNAL\_ERROR}
@@ -11854,18 +11835,7 @@ You attempted an operation that was not 
 You attempted an operation that was not allowed.
 
 \vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}OPERATION_NOT_ALLOWED()\end{verbatim}
-\begin{center}\rule{10em}{0.1pt}\end{center}
-
-\subsubsection{PIF\_HANDLE\_INVALID}
-
-You gave an invalid PIF handle.  The PIF may have recently been deleted. 
-The handle parameter echoes the bad value given.
-
-\vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}PIF_HANDLE_INVALID(handle)\end{verbatim}
+No parameters.
 \begin{center}\rule{10em}{0.1pt}\end{center}
 
 \subsubsection{PIF\_IS\_PHYSICAL}
@@ -11877,16 +11847,6 @@ PIF handle you gave.
 \vspace{0.3cm}
 {\bf Signature:}
 \begin{verbatim}PIF_IS_PHYSICAL(PIF)\end{verbatim}
-\begin{center}\rule{10em}{0.1pt}\end{center}
-
-\subsubsection{PIF\_METRICS\_HANDLE\_INVALID}
-
-You gave an invalid PIF\_metrics handle.  The PIF\_metrics may have
-recently been deleted.  The handle parameter echoes the bad value given.
-
-\vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}PIF_METRICS_HANDLE_INVALID(handle)\end{verbatim}
 \begin{center}\rule{10em}{0.1pt}\end{center}
 
 \subsubsection{SESSION\_AUTHENTICATION\_FAILED}
@@ -11910,26 +11870,6 @@ current connection.  The handle paramete
 \begin{verbatim}SESSION_INVALID(handle)\end{verbatim}
 \begin{center}\rule{10em}{0.1pt}\end{center}
 
-\subsubsection{SR\_HANDLE\_INVALID}
-
-You gave an invalid SR handle.  The SR may have recently been deleted.  The
-handle parameter echoes the bad value given.
-
-\vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}SR_HANDLE_INVALID(handle)\end{verbatim}
-\begin{center}\rule{10em}{0.1pt}\end{center}
-
-\subsubsection{TASK\_HANDLE\_INVALID}
-
-You gave an invalid task handle.  The task may have recently been deleted. 
-The handle parameter echoes the bad value given.
-
-\vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}TASK_HANDLE_INVALID(handle)\end{verbatim}
-\begin{center}\rule{10em}{0.1pt}\end{center}
-
 \subsubsection{VALUE\_NOT\_SUPPORTED}
 
 You attempted to set a value that is not supported by this implementation. 
@@ -11939,36 +11879,6 @@ returned.  Also returned is a developer-
 \vspace{0.3cm}
 {\bf Signature:}
 \begin{verbatim}VALUE_NOT_SUPPORTED(field, value, reason)\end{verbatim}
-\begin{center}\rule{10em}{0.1pt}\end{center}
-
-\subsubsection{VBD\_HANDLE\_INVALID}
-
-You gave an invalid VBD handle.  The VBD may have recently been deleted. 
-The handle parameter echoes the bad value given.
-
-\vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}VBD_HANDLE_INVALID(handle)\end{verbatim}
-\begin{center}\rule{10em}{0.1pt}\end{center}
-
-\subsubsection{VDI\_HANDLE\_INVALID}
-
-You gave an invalid VDI handle.  The VDI may have recently been deleted. 
-The handle parameter echoes the bad value given.
-
-\vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}VDI_HANDLE_INVALID(handle)\end{verbatim}
-\begin{center}\rule{10em}{0.1pt}\end{center}
-
-\subsubsection{VIF\_HANDLE\_INVALID}
-
-You gave an invalid VIF handle.  The VIF may have recently been deleted. 
-The handle parameter echoes the bad value given.
-
-\vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}VIF_HANDLE_INVALID(handle)\end{verbatim}
 \begin{center}\rule{10em}{0.1pt}\end{center}
 
 \subsubsection{VLAN\_TAG\_INVALID}
@@ -11991,36 +11901,6 @@ expected and actual VM state at the time
 \vspace{0.3cm}
 {\bf Signature:}
 \begin{verbatim}VM_BAD_POWER_STATE(vm, expected, actual)\end{verbatim}
-\begin{center}\rule{10em}{0.1pt}\end{center}
-
-\subsubsection{VM\_HANDLE\_INVALID}
-
-You gave an invalid VM handle.  The VM may have recently been deleted.  The
-handle parameter echoes the bad value given.
-
-\vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}VM_HANDLE_INVALID(handle)\end{verbatim}
-\begin{center}\rule{10em}{0.1pt}\end{center}
-
-\subsubsection{VM\_METRICS\_HANDLE\_INVALID}
-
-You gave an invalid VM\_metrics handle.  The VM\_metrics may have recently
-been deleted.  The handle parameter echoes the bad value given.
-
-\vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}VM_METRICS_HANDLE_INVALID(handle)\end{verbatim}
-\begin{center}\rule{10em}{0.1pt}\end{center}
-
-\subsubsection{VTPM\_HANDLE\_INVALID}
-
-You gave an invalid VTPM handle.  The VTPM may have recently been deleted. 
-The handle parameter echoes the bad value given.
-
-\vspace{0.3cm}
-{\bf Signature:}
-\begin{verbatim}VTPM_HANDLE_INVALID(handle)\end{verbatim}
 \begin{center}\rule{10em}{0.1pt}\end{center}
 
 
diff -r f65a24235f58 -r 8bcd71c3b495 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Tue Feb 20 23:54:42 2007 +0000
+++ b/tools/python/xen/xend/XendAPI.py  Tue Feb 20 15:24:01 2007 +0000
@@ -141,11 +141,11 @@ def _is_valid_ref(ref, validator):
 def _is_valid_ref(ref, validator):
     return type(ref) == str and validator(ref)
 
-def _check_ref(validator, errcode, func, api, session, ref, *args, **kwargs):
+def _check_ref(validator, clas, func, api, session, ref, *args, **kwargs):
     if _is_valid_ref(ref, validator):
         return func(api, session, ref, *args, **kwargs)
     else:
-        return xen_api_error([errcode, ref])
+        return xen_api_error(['HANDLE_INVALID', clas, ref])
 
 
 def valid_host(func):
@@ -156,7 +156,7 @@ def valid_host(func):
     """
     return lambda *args, **kwargs: \
            _check_ref(XendNode.instance().is_valid_host,
-                      'HOST_HANDLE_INVALID', func, *args, **kwargs)
+                      'host', func, *args, **kwargs)
 
 def valid_host_metrics(func):
     """Decorator to verify if host_metrics_ref is valid before calling
@@ -167,7 +167,7 @@ def valid_host_metrics(func):
     """
     return lambda *args, **kwargs: \
            _check_ref(lambda r: r == XendNode.instance().host_metrics_uuid,
-                      'HOST_METRICS_HANDLE_INVALID', func, *args, **kwargs)
+                      'host_metrics', func, *args, **kwargs)
 
 def valid_host_cpu(func):
     """Decorator to verify if host_cpu_ref is valid before calling method.
@@ -177,7 +177,7 @@ def valid_host_cpu(func):
     """    
     return lambda *args, **kwargs: \
            _check_ref(XendNode.instance().is_valid_cpu,
-                      'HOST_CPU_HANDLE_INVALID', func, *args, **kwargs)
+                      'host_cpu', func, *args, **kwargs)
 
 def valid_vm(func):
     """Decorator to verify if vm_ref is valid before calling method.
@@ -187,7 +187,7 @@ def valid_vm(func):
     """    
     return lambda *args, **kwargs: \
            _check_ref(XendDomain.instance().is_valid_vm,
-                      'VM_HANDLE_INVALID', func, *args, **kwargs)
+                      'VM', func, *args, **kwargs)
 
 def valid_network(func):
     """Decorator to verify if network_ref is valid before calling method.
@@ -197,7 +197,7 @@ def valid_network(func):
     """    
     return lambda *args, **kwargs: \
            _check_ref(XendNode.instance().is_valid_network,
-                      'NETWORK_HANDLE_INVALID', func, *args, **kwargs)
+                      'network', func, *args, **kwargs)
 
 def valid_vbd(func):
     """Decorator to verify if vbd_ref is valid before calling method.
@@ -207,7 +207,7 @@ def valid_vbd(func):
     """    
     return lambda *args, **kwargs: \
            _check_ref(lambda r: XendDomain.instance().is_valid_dev('vbd', r),
-                      'VBD_HANDLE_INVALID', func, *args, **kwargs)
+                      'VBD', func, *args, **kwargs)
 
 def valid_vif(func):
     """Decorator to verify if vif_ref is valid before calling method.
@@ -217,7 +217,7 @@ def valid_vif(func):
     """
     return lambda *args, **kwargs: \
            _check_ref(lambda r: XendDomain.instance().is_valid_dev('vif', r),
-                      'VIF_HANDLE_INVALID', func, *args, **kwargs)
+                      'VIF', func, *args, **kwargs)
 
 def valid_vdi(func):
     """Decorator to verify if vdi_ref is valid before calling method.
@@ -227,7 +227,7 @@ def valid_vdi(func):
     """
     return lambda *args, **kwargs: \
            _check_ref(XendNode.instance().is_valid_vdi,
-                      'VDI_HANDLE_INVALID', func, *args, **kwargs)
+                      'VDI', func, *args, **kwargs)
 
 def valid_vtpm(func):
     """Decorator to verify if vtpm_ref is valid before calling method.
@@ -237,7 +237,7 @@ def valid_vtpm(func):
     """
     return lambda *args, **kwargs: \
            _check_ref(lambda r: XendDomain.instance().is_valid_dev('vtpm', r),
-                      'VTPM_HANDLE_INVALID', func, *args, **kwargs)
+                      'VTPM', func, *args, **kwargs)
 
 
 def valid_console(func):
@@ -249,7 +249,7 @@ def valid_console(func):
     return lambda *args, **kwargs: \
            _check_ref(lambda r: XendDomain.instance().is_valid_dev('console',
                                                                    r),
-                      'CONSOLE_HANDLE_INVALID', func, *args, **kwargs)
+                      'console', func, *args, **kwargs)
 
 def valid_sr(func):
     """Decorator to verify if sr_ref is valid before calling method.
@@ -259,7 +259,7 @@ def valid_sr(func):
     """
     return lambda *args, **kwargs: \
            _check_ref(lambda r: XendNode.instance().is_valid_sr,
-                      'SR_HANDLE_INVALID', func, *args, **kwargs)
+                      'SR', func, *args, **kwargs)
 
 def valid_pif(func):
     """Decorator to verify if pif_ref is valid before calling
@@ -270,7 +270,7 @@ def valid_pif(func):
     """
     return lambda *args, **kwargs: \
            _check_ref(lambda r: r in XendNode.instance().pifs,
-                      'PIF_HANDLE_INVALID', func, *args, **kwargs)
+                      'PIF', func, *args, **kwargs)
 
 def valid_pif_metrics(func):
     """Decorator to verify if pif_metrics_ref is valid before calling
@@ -281,7 +281,7 @@ def valid_pif_metrics(func):
     """
     return lambda *args, **kwargs: \
            _check_ref(lambda r: r in XendNode.instance().pif_metrics,
-                      'PIF_METRICS_HANDLE_INVALID', func, *args, **kwargs)
+                      'PIF_metrics', func, *args, **kwargs)
 
 def valid_task(func):
     """Decorator to verify if task_ref is valid before calling
@@ -292,7 +292,7 @@ def valid_task(func):
     """
     return lambda *args, **kwargs: \
            _check_ref(XendTaskManager.get_task,
-                      'TASK_HANDLE_INVALID', func, *args, **kwargs)
+                      'task', func, *args, **kwargs)
 
 def valid_debug(func):
     """Decorator to verify if task_ref is valid before calling
@@ -303,7 +303,7 @@ def valid_debug(func):
     """
     return lambda *args, **kwargs: \
            _check_ref(lambda r: r in XendAPI._debug,
-                      'TASK_HANDLE_INVALID', func, *args, **kwargs)
+                      'debug', func, *args, **kwargs)
 
 # -----------------------------
 # Bridge to Legacy XM API calls
@@ -908,7 +908,7 @@ class XendAPI(object):
                 return xen_api_success(
                     node.PIF_create_VLAN(ref, network, vlan))
             else:
-                return xen_api_error(['NETWORK_HANDLE_INVALID', network])
+                return xen_api_error(['HANDLE_INVALID', 'network', network])
         except NetworkAlreadyConnected, exn:
             return xen_api_error(['NETWORK_ALREADY_CONNECTED',
                                   network, exn.pif_uuid])
@@ -1352,7 +1352,7 @@ class XendAPI(object):
         xendom = XendDomain.instance()
         xeninfo = xendom.get_vm_by_uuid(vm_ref)
         if not xeninfo:
-            return xen_api_error(['VM_HANDLE_INVALID', vm_ref])
+            return xen_api_error(['HANDLE_INVALID', 'VM', vm_ref])
         
         record = {
             'uuid': xeninfo.get_uuid(),
@@ -1469,10 +1469,10 @@ class XendAPI(object):
         xendom = XendDomain.instance()
         vm = xendom.get_vm_with_dev_uuid('vbd', vbd_ref)
         if not vm:
-            return xen_api_error(['VBD_HANDLE_INVALID', vbd_ref])
+            return xen_api_error(['HANDLE_INVALID', 'VBD', vbd_ref])
         cfg = vm.get_dev_xenapi_config('vbd', vbd_ref)
         if not cfg:
-            return xen_api_error(['VBD_HANDLE_INVALID', vbd_ref])
+            return xen_api_error(['HANDLE_INVALID', 'VBD', vbd_ref])
 
         valid_vbd_keys = self.VBD_attr_ro + self.VBD_attr_rw + \
                          self.Base_attr_ro + self.Base_attr_rw
@@ -1491,7 +1491,7 @@ class XendAPI(object):
     def VBD_create(self, session, vbd_struct):
         xendom = XendDomain.instance()
         if not xendom.is_valid_vm(vbd_struct['VM']):
-            return xen_api_error(['VM_HANDLE_INVALID', vbd_struct['VM']])
+            return xen_api_error(['HANDLE_INVALID', 'VM', vbd_struct['VM']])
         
         dom = xendom.get_vm_by_uuid(vbd_struct['VM'])
         vbd_ref = ''
@@ -1500,7 +1500,7 @@ class XendAPI(object):
             vdi_ref = vbd_struct.get('VDI')
             vdi = XendNode.instance().get_vdi_by_uuid(vdi_ref)
             if not vdi:
-                return xen_api_error(['VDI_HANDLE_INVALID', vdi_ref])
+                return xen_api_error(['HANDLE_INVALID', 'VDI', vdi_ref])
             vdi_image = vdi.get_location()
             vbd_ref = XendTask.log_progress(0, 100,
                                             dom.create_vbd,
@@ -1516,7 +1516,7 @@ class XendAPI(object):
         xendom = XendDomain.instance()
         vm = xendom.get_vm_with_dev_uuid('vbd', vbd_ref)
         if not vm:
-            return xen_api_error(['VBD_HANDLE_INVALID', vbd_ref])
+            return xen_api_error(['HANDLE_INVALID', 'VBD', vbd_ref])
 
         XendTask.log_progress(0, 100, vm.destroy_vbd, vbd_ref)
         return xen_api_success_void()
@@ -1586,10 +1586,10 @@ class XendAPI(object):
         xendom = XendDomain.instance()
         vm = xendom.get_vm_with_dev_uuid('vif', vif_ref)
         if not vm:
-            return xen_api_error(['VIF_HANDLE_INVALID', vif_ref])
+            return xen_api_error(['HANDLE_INVALID', 'VIF', vif_ref])
         cfg = vm.get_dev_xenapi_config('vif', vif_ref)
         if not cfg:
-            return xen_api_error(['VIF_HANDLE_INVALID', vif_ref])
+            return xen_api_error(['HANDLE_INVALID', 'VIF', vif_ref])
         
         valid_vif_keys = self.VIF_attr_ro + self.VIF_attr_rw + \
                          self.Base_attr_ro + self.Base_attr_rw
@@ -1613,14 +1613,14 @@ class XendAPI(object):
             except XendError:
                 return xen_api_error(XEND_ERROR_TODO)
         else:
-            return xen_api_error(['VM_HANDLE_INVALID', vif_struct['VM']])
+            return xen_api_error(['HANDLE_INVALID', 'VM', vif_struct['VM']])
 
 
     def VIF_destroy(self, session, vif_ref):
         xendom = XendDomain.instance()
         vm = xendom.get_vm_with_dev_uuid('vif', vif_ref)
         if not vm:
-            return xen_api_error(['VIF_HANDLE_INVALID', vif_ref])
+            return xen_api_error(['HANDLE_INVALID', 'VIF', vif_ref])
 
         vm.destroy_vif(vif_ref)
         return xen_api_success_void()
@@ -1766,7 +1766,7 @@ class XendAPI(object):
         sr_ref = vdi_struct.get('SR')
         xennode = XendNode.instance()
         if not xennode.is_valid_sr(sr_ref):
-            return xen_api_error(['SR_HANDLE_INVALID', sr_ref])
+            return xen_api_error(['HANDLE_INVALID', 'SR', sr_ref])
 
         vdi_uuid = xennode.srs[sr_ref].create_vdi(vdi_struct)
         return xen_api_success(vdi_uuid)
@@ -1797,10 +1797,10 @@ class XendAPI(object):
         xendom = XendDomain.instance()
         vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
         if not vm:
-            return xen_api_error(['VTPM_HANDLE_INVALID', vtpm_ref])
+            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
         cfg = vm.get_dev_xenapi_config('vtpm', vtpm_ref)
         if not cfg:
-            return xen_api_error(['VTPM_HANDLE_INVALID', vtpm_ref])
+            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
         valid_vtpm_keys = self.VTPM_attr_ro + self.VTPM_attr_rw + \
                           self.Base_attr_ro + self.Base_attr_rw
         return_cfg = {}
@@ -1815,10 +1815,10 @@ class XendAPI(object):
         xendom = XendDomain.instance()
         vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
         if not vm:
-            return xen_api_error(['VTPM_HANDLE_INVALID', vtpm_ref])
+            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
         cfg = vm.get_dev_xenapi_config('vtpm', vtpm_ref)
         if not cfg:
-            return xen_api_error(['VTPM_HANDLE_INVALID', vtpm_ref])
+            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
         if not cfg.has_key('backend'):
             return xen_api_error(['VTPM backend not set'])
         return xen_api_success(cfg['backend'])
@@ -1841,7 +1841,7 @@ class XendAPI(object):
             tpmif.destroy_vtpmstate(dom.getName())
             return xen_api_success(True)
         else:
-            return xen_api_error(['VM_HANDLE_INVALID', vtpm_struct['VM']])
+            return xen_api_error(['HANDLE_INVALID', 'VM', vtpm_struct['VM']])
 
     # class methods
     def VTPM_create(self, session, vtpm_struct):
@@ -1855,7 +1855,7 @@ class XendAPI(object):
             except XendError:
                 return xen_api_error(XEND_ERROR_TODO)
         else:
-            return xen_api_error(['VM_HANDLE_INVALID', vtpm_struct['VM']])
+            return xen_api_error(['HANDLE_INVALID', 'VM', vtpm_struct['VM']])
 
     def VTPM_get_all(self, session):
         xendom = XendDomain.instance()
@@ -1897,10 +1897,10 @@ class XendAPI(object):
         xendom = XendDomain.instance()
         vm = xendom.get_vm_with_dev_uuid('console', console_ref)
         if not vm:
-            return xen_api_error(['CONSOLE_HANDLE_INVALID', console_ref])
+            return xen_api_error(['HANDLE_INVALID', 'console', console_ref])
         cfg = vm.get_dev_xenapi_config('console', console_ref)
         if not cfg:
-            return xen_api_error(['CONSOLE_HANDLE_INVALID', console_ref])
+            return xen_api_error(['HANDLE_INVALID', 'console', console_ref])
         
         valid_console_keys = self.console_attr_ro + self.console_attr_rw + \
                              self.Base_attr_ro + self.Base_attr_rw
@@ -1915,7 +1915,8 @@ class XendAPI(object):
     def console_create(self, session, console_struct):
         xendom = XendDomain.instance()
         if not xendom.is_valid_vm(console_struct['VM']):
-            return xen_api_error(['VM_HANDLE_INVALID', console_struct['VM']])
+            return xen_api_error(['HANDLE_INVALID', 'VM',
+                                  console_struct['VM']])
         
         dom = xendom.get_vm_by_uuid(console_struct['VM'])
         try:
@@ -1972,7 +1973,7 @@ class XendAPI(object):
         sr = XendNode.instance().get_sr(sr_ref)
         if sr:
             return xen_api_success(sr.get_record())
-        return xen_api_error(['SR_HANDLE_INVALID', sr_ref])
+        return xen_api_error(['HANDLE_INVALID', 'SR', sr_ref])
 
     # Attribute acceess
 
diff -r f65a24235f58 -r 8bcd71c3b495 tools/python/xen/xm/messages/en/xen-xm.po
--- a/tools/python/xen/xm/messages/en/xen-xm.po Tue Feb 20 23:54:42 2007 +0000
+++ b/tools/python/xen/xm/messages/en/xen-xm.po Tue Feb 20 15:24:01 2007 +0000
@@ -19,7 +19,7 @@ msgid ""
 msgid ""
 msgstr ""
 "Project-Id-Version: Xen-xm 3.0\n"
-"PO-Revision-Date: 2007-01-31 12:34+0000\n"
+"PO-Revision-Date: 2007-02-20 15:22+0000\n"
 "Last-Translator: Ewan Mellor <ewan@xxxxxxxxxxxxx>\n"
 "Language-Team: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>\n"
 "MIME-Version: 1.0\n"
@@ -44,44 +44,8 @@ msgid "VALUE_NOT_SUPPORTED"
 msgid "VALUE_NOT_SUPPORTED"
 msgstr "Value \"%(2)s\" for %(1)s is not supported by this server.  The server 
said \"%(3)s\"."
 
-msgid "HOST_CPU_HANDLE_INVALID"
-msgstr "The host_cpu handle %(1)s is invalid."
-
-msgid "HOST_HANDLE_INVALID"
-msgstr "The host handle %(1)s is invalid."
-
-msgid "HOST_METRICS_HANDLE_INVALID"
-msgstr "The host_metrics handle %(1)s is invalid."
-
-msgid "PIF_HANDLE_INVALID"
-msgstr "The PIF handle %(1)s is invalid."
-
-msgid "PIF_METRICS_HANDLE_INVALID"
-msgstr "The PIF_METRICS handle %(1)s is invalid."
-
-msgid "SR_HANDLE_INVALID"
-msgstr "The SR handle %(1)s is invalid."
-
-msgid "TASK_HANDLE_INVALID"
-msgstr "The task handle %(1)s is invalid."
-
-msgid "VBD_HANDLE_INVALID"
-msgstr "The VBD handle %(1)s is invalid."
-
-msgid "VDI_HANDLE_INVALID"
-msgstr "The VDI handle %(1)s is invalid."
-
-msgid "VIF_HANDLE_INVALID"
-msgstr "The VIF handle %(1)s is invalid."
-
-msgid "VM_HANDLE_INVALID"
-msgstr "The VM handle %(1)s is invalid."
-
-msgid "VM_METRICS_HANDLE_INVALID"
-msgstr "The VM_metrics handle %(1)s is invalid."
-
-msgid "VTPM_HANDLE_INVALID"
-msgstr "The VTPM handle %(1)s is invalid."
+msgid "HANDLE_INVALID"
+msgstr "The %(1)s handle %(2)s is invalid."
 
 msgid "OPERATION_NOT_ALLOWED"
 msgstr "You attempted an operation that was not allowed."

_______________________________________________
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] Replace the X_HANDLE_INVALID error codes with a single HANDLE_INVALID that, Xen patchbot-unstable <=