]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Fix the jeos path when running from installed code.
authorAngus Salkeld <asalkeld@redhat.com>
Fri, 13 Apr 2012 02:37:13 +0000 (12:37 +1000)
committerAngus Salkeld <asalkeld@redhat.com>
Fri, 13 Apr 2012 02:38:47 +0000 (12:38 +1000)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
bin/heat

index a532418899419a963bff94484904452dc1e43451..f33a81f1c0c0c2f974b2f60cc5851543e9613ad4 100755 (executable)
--- 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