mirror of
https://github.com/dirkjanm/ROADtools
synced 2026-06-08 13:48:32 +00:00
Merge pull request #93 from cirosec/docker-describe
Fixed parsing bug when roadtx is run inside docker
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user