Skip to content
Snippets Groups Projects
Commit 77c11ae8 authored by Václav Bartoš's avatar Václav Bartoš Committed by Pavel Kácha
Browse files

client: read_cfg handling of relative paths changed

read_cfg() no longer add directory of warden_client.py in front of the config file name. It simply opens the path/filename passed. This allows to install warden_client.py to system paths and use relative paths to config files, but IT MAY BROKE SOME EXISTING INSTALLATIONS if they use relative path to config file and run script from different directory than where warden_client.py is located.
parent 80a58c64
No related branches found
No related tags found
No related merge requests found
......@@ -662,7 +662,6 @@ def format_time(year, month, day, hour, minute, second, microsec=0, utcoffset=No
def read_cfg(cfgfile):
abspath = path.join(path.dirname(__file__), cfgfile)
with open(abspath, "r") as f:
with open(cfgfile, "r") as f:
stripcomments = "\n".join((l for l in f if not l.lstrip().startswith(("#", "//"))))
return json.loads(stripcomments)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment