|   | 
      | 
  
  
      | 
      | 
  
 
     | 
    | 
  
  
     | 
    | 
  
  
    |   | 
      | 
  
  
    | 
         
xen-api
[Xen-API] [PATCH] pass xapi's PATH to processes forked by	Helpers.call_s
 
# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1261431390 0
# Node ID 08568ec81804c71765ec961e8c72b00124f51f66
# Parent  cc0afedf09b9fcaf35f57678dcba55ed762fb4ed
CA-36084: pass xapi's $PATH to processes forked by Helpers.call_script
Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>
diff -r cc0afedf09b9 -r 08568ec81804 ocaml/xapi/helpers.ml
--- a/ocaml/xapi/helpers.ml     Mon Dec 21 21:10:02 2009 +0000
+++ b/ocaml/xapi/helpers.ml     Mon Dec 21 21:36:30 2009 +0000
@@ -580,7 +580,9 @@
 let call_script ?(log_successful_output=true) script args = 
   try
     Unix.access script [ Unix.X_OK ];
-    let output, _ = Forkhelpers.execute_command_get_output script args in
+       (* Use the same $PATH as xapi *)
+       let env = [| "PATH=" ^ (Sys.getenv "PATH") |] in
+    let output, _ = Forkhelpers.execute_command_get_output ~env script args in
     if log_successful_output then debug "%s %s succeeded [ output = '%s' ]" 
script (String.concat " " args) output;
     output
   with 
1 file changed, 3 insertions(+), 1 deletion(-)
ocaml/xapi/helpers.ml |    4 +++-
 
xen-api.hg.patch 
Description: Text Data 
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
 
 |   
 
| <Prev in Thread] | 
Current Thread | 
[Next in Thread> |  
- [Xen-API] [PATCH] pass xapi's PATH to processes forked by	Helpers.call_script,
David Scott <=
  
 |  
  
 | 
    | 
  
  
    |   | 
    |