X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=geni%2Fgimport.py;h=fd886890583916e91b4737e3ab3d181566ee16bc;hb=8ca8a46ea2f403edf40a3d0c8c35cb631b792564;hp=1d273a7b2364b2776751d1c35cf1ec0e7356a77f;hpb=ce3691a4120e6b4e63da4b614d8ccf39e3f132c9;p=sfa.git diff --git a/geni/gimport.py b/geni/gimport.py index 1d273a7b..fd886890 100755 --- a/geni/gimport.py +++ b/geni/gimport.py @@ -52,8 +52,23 @@ root_auth = config.GENI_REGISTRY_ROOT_AUTH level1_auth = config.GENI_REGISTRY_LEVEL1_AUTH if not level1_auth or level1_auth in ['']: level1_auth = None -keyconvert_fn = config.GENI_BASE_DIR + os.sep + "keyconvert/keyconvert" +keyconvert = 'keyconvert' +loaded = False +default_path = "/usr/shre/keyconvert/" + keyconvert +cwd = os.path.dirname(os.path.abspath(__file__)) +alt_path = os.sep.join(cwd.split(os.sep)[:-1] + ['keyconvert', 'keyconvert']) +files = [default_path, alt_path] +for path in files: + if os.path.isfile(path): + keyconvert_fn = path + loaded = True + +if not loaded: + raise Exception, "Could not find config in " + ", ".join(files) + +keyconvert_fn = config.GENI_BASE_DIR + os.sep + "keyconvert/keyconvert" +alt_keyconvert_fn def un_unicode(str): if isinstance(str, unicode):