summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-05-17 19:28:16 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-05-17 19:28:16 +0200
commitbcf16599846f4fbce3b603231888b1aeb3aa3519 (patch)
tree3d668ea4f5812ae20cbe6ecfa5fe4a53bf126059
parent40b3595281a8678246613ed0dcf5b68737339464 (diff)
downloadtools-bcf16599846f4fbce3b603231888b1aeb3aa3519.tar.gz
tools-bcf16599846f4fbce3b603231888b1aeb3aa3519.tar.bz2
tools-bcf16599846f4fbce3b603231888b1aeb3aa3519.zip
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.
-rwxr-xr-xbin/hostinfo2
1 files changed, 1 insertions, 1 deletions
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