ia64/xen-unstable

view tools/python/xen/util/auxbin.py @ 19819:c1bdfb5c3c5c

tools python: remove unused auxbin functions

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 23 17:26:28 2009 +0100 (2009-06-23)
parents b55070edb185
children
line source
1 #============================================================================
2 # This library is free software; you can redistribute it and/or
3 # modify it under the terms of version 2.1 of the GNU Lesser General Public
4 # License as published by the Free Software Foundation.
5 #
6 # This library is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 # Lesser General Public License for more details.
10 #
11 # You should have received a copy of the GNU Lesser General Public
12 # License along with this library; if not, write to the Free Software
13 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14 #============================================================================
15 # Copyright (C) 2005-2006 XenSource Inc.
16 #============================================================================
19 import os
20 import os.path
21 import sys
22 from xen.util.path import *
24 def execute(exe, args = None):
25 exepath = pathTo(exe)
26 a = [ exepath ]
27 if args:
28 a.extend(args)
29 try:
30 os.execv(exepath, a)
31 except OSError, exn:
32 print exepath, ": ", exn
33 sys.exit(1)
35 SEARCHDIRS = [ BINDIR, SBINDIR, LIBEXEC, PRIVATE_BINDIR, XENFIRMWAREDIR ]
36 def pathTo(exebin):
37 for dir in SEARCHDIRS:
38 exe = os.path.join(dir, exebin)
39 if os.path.exists(exe):
40 return exe
41 return None
43 def xen_configdir():
44 return XEN_CONFIG_DIR
46 def scripts_dir():
47 return XEN_SCRIPT_DIR