[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.