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] pass xapi's PATH to processes forked by Helpers.call_s

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] pass xapi's PATH to processes forked by Helpers.call_script
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Mon, 21 Dec 2009 21:37:04 +0000
Delivery-date: Mon, 21 Dec 2009 13:31:23 -0800
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
# 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 +++-


Attachment: 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 <=