Fix the jeos path when running from installed code.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
Angus Salkeld 2012-04-13 12:37:13 +10:00
parent c453a33f35
commit 2a9a87dc3e
1 changed files with 9 additions and 7 deletions

View File

@ -30,18 +30,20 @@ if os.path.exists(os.path.join(possible_topdir, 'heat', '__init__.py')):
jeos_path = '%s/heat/%s/' % (possible_topdir, "jeos") jeos_path = '%s/heat/%s/' % (possible_topdir, "jeos")
cfntools_path = '%s/heat/%s/' % (possible_topdir, "cfntools") cfntools_path = '%s/heat/%s/' % (possible_topdir, "cfntools")
else: else:
jeos_path = '%s/heat/%s/' % (sys.path[1], "jeos") for p in sys.path:
cfntools_path = '%s/heat/%s/' % (sys.path[1], "cfntools") if 'heat' in p:
jeos_path = '%s/heat/%s/' % (p, "jeos")
cfntools_path = '%s/heat/%s/' % (p, "cfntools")
break
gettext.install('heat', unicode=1) gettext.install('heat', unicode=1)
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 glance import client as glance_client
from heat import client as heat_client
from heat import version
from heat.common import config
from heat.common import exception
from distutils.sysconfig import get_python_lib
SUCCESS = 0 SUCCESS = 0
FAILURE = 1 FAILURE = 1