Skip to content

Commit

Permalink
ensure cmd is a well formed json string (OpenBB-finance#2523)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoaquim authored Sep 12, 2022
1 parent 1bdaa03 commit a73c123
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions openbb_terminal/parent_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import os
import difflib
import logging
import json

from typing import Union, List, Dict, Any
from datetime import datetime, timedelta
Expand Down Expand Up @@ -242,13 +243,14 @@ def log_cmd_and_queue(
self, known_cmd: str, other_args_str: str, the_input: str
) -> None:
if not self.contains_keys(the_input):
logger.info(
"CMD: {'path': '%s', 'known_cmd': '%s', 'other_args': '%s', 'input': '%s'}",
self.PATH,
known_cmd,
other_args_str,
the_input,
)
cmd = {
"path": self.PATH,
"known_cmd": known_cmd,
"other_args": other_args_str,
"input": the_input,
}
logger.info("CMD: %s", json.dumps(cmd))

if the_input not in self.KEYS_MENU:
self.log_queue()

Expand Down

0 comments on commit a73c123

Please sign in to comment.