Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed parsing bug when roadtx is run inside docker #93

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions roadtx/roadtools/roadtx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,13 +1115,16 @@ def main():
if args.verbose:
print("[debug] Reading token value from stdin.")
tokendata = sys.stdin.read()
# Describing saved token file args.tokenfile
elif os.path.exists(args.tokenfile):
if args.verbose:
print("[debug] Reading token value from file '%s'." % (args.tokenfile))
f = open(args.tokenfile, "r")
tokendata = f.read()
f.close()
# Maybe some of the above had already tokendata set. But in Docker isatty is false.. so check if tokendata is None at this point
# Otherwise read it from default file
if not tokendata or tokendata == "":
# Describing saved token file args.tokenfile
if os.path.exists(args.tokenfile):
if args.verbose:
print("[debug] Reading token value from file '%s'." % (args.tokenfile))
f = open(args.tokenfile, "r")
tokendata = f.read()
f.close()
if tokendata[0] == '{':
# assume json object
tokenobject = json.loads(tokendata)
Expand Down