aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-05-24 15:30:05 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-05-24 15:30:05 +0100
commita6164848501f14b3fca0938abf03ffa1602f20c1 (patch)
tree81ef284925d45eae04734b086f21661dd31abd16
parentf910c09590b907c9766a7a1c743311234d20f20e (diff)
downloadxen-a6164848501f14b3fca0938abf03ffa1602f20c1.tar.gz
xen-a6164848501f14b3fca0938abf03ffa1602f20c1.tar.bz2
xen-a6164848501f14b3fca0938abf03ffa1602f20c1.zip
xend: Add site-packages into Python search path
Signed-off-by: S.Caglar Onur <caglar@pardus.org.tr>
-rw-r--r--tools/misc/xen-python-path13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/misc/xen-python-path b/tools/misc/xen-python-path
index 03c572b8ef..da3d2dd2ba 100644
--- a/tools/misc/xen-python-path
+++ b/tools/misc/xen-python-path
@@ -30,12 +30,13 @@ import sys
for p in ['python%s' % sys.version[:3], 'python']:
for l in ['/usr/lib64', '/usr/lib']:
- d = os.path.join(l, p)
- if os.path.exists(os.path.join(d, AUXBIN)):
- sys.path.append(d)
- import xen.util.auxbin
- print os.path.join(xen.util.auxbin.libpath(), p)
- sys.exit(0)
+ for k in ['', 'site-packages/']:
+ d = os.path.join(l, p, k)
+ if os.path.exists(os.path.join(d, AUXBIN)):
+ sys.path.append(d)
+ import xen.util.auxbin
+ print os.path.join(xen.util.auxbin.libpath(), p)
+ sys.exit(0)
print >>sys.stderr, "Cannot find Xen Python modules."
sys.exit(1)