From 8feaf78a8bc5eddd88a2205205a5f7b1e47e891c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 1 Dec 2014 17:43:22 +0100 Subject: [PATCH] fix calling update.py with relative path --- update.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/update.py b/update.py index ade41782..85a69417 100755 --- a/update.py +++ b/update.py @@ -1,11 +1,11 @@ #!/usr/bin/python import os -root_dir = os.path.normpath(os.path.abspath(os.path.dirname(__file__))) -os.chdir(root_dir) +base = os.path.normpath(os.path.abspath(os.path.dirname(__file__))) +os.chdir(base) #using virtualenv's activate_this.py to reorder sys.path -activate_this = os.path.join(root_dir, 'bin', 'activate_this.py') +activate_this = os.path.join(base, 'bin', 'activate_this.py') if os.path.exists(activate_this): execfile(activate_this, dict(__file__=activate_this)) @@ -58,7 +58,6 @@ def reload_notice(base): print '\nPlease restart pan.do/ra to finish the update:\n\t"sudo %s/ctl reload"\n' % base if __name__ == "__main__": - base = os.path.normpath(os.path.abspath(os.path.dirname(__file__))) if len(sys.argv) == 2 and sys.argv[1] in ('database', 'db'): os.chdir(join(base, 'pandora')) if get('./manage.py', 'south_installed').strip() == 'yes':