Skip to content

Commit

Permalink
Use Nova's path trick in all bins...
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Feb 21, 2011
1 parent 45618b7 commit bb5f122
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 15 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ include tests/utils.py
include run_tests.py
include glance/registry/db/migrate_repo/migrate.cfg
graft doc
graft etc
graft tools
10 changes: 7 additions & 3 deletions bin/glance-api
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ import optparse
import os
import sys

ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

sys.path.append(ROOT_DIR)
# If ../glance/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
sys.path.insert(0, possible_topdir)

from glance import version
from glance.common import config
Expand Down
10 changes: 7 additions & 3 deletions bin/glance-combined
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ import optparse
import os
import sys

ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

sys.path.append(ROOT_DIR)
# If ../glance/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
sys.path.insert(0, possible_topdir)

from glance import version
from glance.common import config
Expand Down
10 changes: 7 additions & 3 deletions bin/glance-control
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ import signal
import sys
import time

ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

sys.path.append(ROOT_DIR)
# If ../glance/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
sys.path.insert(0, possible_topdir)

from glance import version
from glance.common import config
Expand Down
10 changes: 7 additions & 3 deletions bin/glance-manage
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ import optparse
import os
import sys

ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

sys.path.append(ROOT_DIR)
# If ../glance/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
sys.path.insert(0, possible_topdir)

from glance import version as glance_version
from glance.common import config
Expand Down
10 changes: 7 additions & 3 deletions bin/glance-registry
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ import optparse
import os
import sys

ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

sys.path.append(ROOT_DIR)
# If ../glance/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
sys.path.insert(0, possible_topdir)

from glance import version
from glance.common import config
Expand Down

0 comments on commit bb5f122

Please sign in to comment.