From 2a9a87dc3e22bf1d045add1351cb1bad332a1b5e Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Fri, 13 Apr 2012 12:37:13 +1000 Subject: [PATCH] Fix the jeos path when running from installed code. Signed-off-by: Angus Salkeld --- bin/heat | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/heat b/bin/heat index a5324188..f33a81f1 100755 --- a/bin/heat +++ b/bin/heat @@ -30,18 +30,20 @@ if os.path.exists(os.path.join(possible_topdir, 'heat', '__init__.py')): jeos_path = '%s/heat/%s/' % (possible_topdir, "jeos") cfntools_path = '%s/heat/%s/' % (possible_topdir, "cfntools") else: - jeos_path = '%s/heat/%s/' % (sys.path[1], "jeos") - cfntools_path = '%s/heat/%s/' % (sys.path[1], "cfntools") + for p in sys.path: + if 'heat' in p: + jeos_path = '%s/heat/%s/' % (p, "jeos") + cfntools_path = '%s/heat/%s/' % (p, "cfntools") + break gettext.install('heat', unicode=1) +from glance import client as glance_client from heat import client as heat_client -from heat.common import exception -from heat.common import config from heat import version -from glance import client as glance_client +from heat.common import config +from heat.common import exception -from distutils.sysconfig import get_python_lib SUCCESS = 0 FAILURE = 1 -- 2.45.2