From 46404014a08158d1b8c491cda26f9880576ebe4c Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sat, 15 Aug 2015 09:05:40 +0300 Subject: rz-user-tool: support multiple install locations (hack, should have externally setup system path) --- src/local/server-tools/rz-user-tool.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/local/server-tools/rz-user-tool.py b/src/local/server-tools/rz-user-tool.py index 24dc3c20..55c6bdad 100755 --- a/src/local/server-tools/rz-user-tool.py +++ b/src/local/server-tools/rz-user-tool.py @@ -24,8 +24,13 @@ import re import sys from getpass import getpass -server_path = os.path.realpath(os.path.join(os.path.dirname(sys.modules[__name__].__file__), '..', '..', 'server')) -if not os.path.exists(server_path): +server_path = None +for parts in [('..', '..', 'server'), ('..', '..', 'rhizi-server')]: + candidate = os.path.realpath(os.path.join(os.path.dirname(sys.modules[__name__].__file__), *parts)) + if os.path.exists(candidate): + server_path = candidate + break +if server_path is None: print("error: path not setup correctly") raise SystemExit sys.path.append(server_path) -- cgit v1.3.1