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-api

[Xen-API] [PATCH]Make error msg more readable when sr-create returns sr_

To: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH]Make error msg more readable when sr-create returns sr_backend_failure
From: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
Date: Tue, 20 Apr 2010 14:22:03 +0800
Delivery-date: Mon, 19 Apr 2010 23:19:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (X11/20090817)
Make error msg more readable when sr-create returns sr_backend_failure.I think 
it is a bug here.

before:
# xe sr-create name-label=test type=iso 
device-config:location=/var/opt/xen/iso_import/test 
device-config:legacy_mode=true content-type=iso
Error code: SR_BACKEND_FAILURE_226
Error parameters: , Invalid local path,

after:
# xe sr-create name-label=test type=iso 
device-config:location=/var/opt/xen/iso_import/test 
device-config:legacy_mode=true content-type=iso
There was an SR backend failure.
status: SR_BACKEND_FAILURE_226
stdout: Invalid local path
stderr: 

Signed-off-by: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>

diff -r ad754527bddd ocaml/xapi/sm_exec.ml
--- a/ocaml/xapi/sm_exec.ml     Fri Apr 16 11:44:32 2010 +0100
+++ b/ocaml/xapi/sm_exec.ml     Tue Apr 20 09:45:09 2010 -0400
@@ -197,7 +197,7 @@ let exec_xmlrpc ?context ?(needs_session
          
     | XMLRPC.Fault(code, reason) ->
        let xenapi_code = Api_errors.sr_backend_failure ^ "_" ^ 
(Int32.to_string code) in
-       raise (Api_errors.Server_error(xenapi_code, [ ""; reason; stderr ]))
+       raise (Api_errors.Server_error(Api_errors.sr_backend_failure, 
[xenapi_code; reason; stderr]))
          
     | XMLRPC.Success [ result ] -> result in
   if needs_session

-- 
Regards
Yang Hongyang
diff -r ad754527bddd ocaml/xapi/sm_exec.ml
--- a/ocaml/xapi/sm_exec.ml     Fri Apr 16 11:44:32 2010 +0100
+++ b/ocaml/xapi/sm_exec.ml     Tue Apr 20 09:45:09 2010 -0400
@@ -197,7 +197,7 @@ let exec_xmlrpc ?context ?(needs_session
          
     | XMLRPC.Fault(code, reason) ->
        let xenapi_code = Api_errors.sr_backend_failure ^ "_" ^ 
(Int32.to_string code) in
-       raise (Api_errors.Server_error(xenapi_code, [ ""; reason; stderr ]))
+       raise (Api_errors.Server_error(Api_errors.sr_backend_failure, 
[xenapi_code; reason; stderr]))
          
     | XMLRPC.Success [ result ] -> result in
   if needs_session
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>