From bcf16599846f4fbce3b603231888b1aeb3aa3519 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 17 May 2013 19:28:16 +0200 Subject: bin/hostinfo: use realpath do find relativ lib path Use os.path.realpath(__file__) to find the path of the script. This works also if executed via symlink. --- bin/hostinfo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/hostinfo b/bin/hostinfo index e9a92ec..7fb1e9b 100755 --- a/bin/hostinfo +++ b/bin/hostinfo @@ -8,7 +8,7 @@ import yaml import os from dns import resolver,reversename -own_directory = os.path.dirname(os.path.abspath(__file__)) +own_directory = os.path.dirname(os.path.abspath(os.path.realpath(__file__))) lib = os.path.join(own_directory, '..') if os.path.exists(os.path.join(lib, 'hostinfo')): sys.path = [lib] + sys.path -- cgit v1.2.3-1-g7c22