Add sys.path adjustment magic to glance-upload.
This commit is contained in:
@@ -48,8 +48,17 @@ Usage
|
||||
# available
|
||||
import argparse
|
||||
import pprint
|
||||
import os
|
||||
import sys
|
||||
|
||||
# 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.client import Client
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user