Skip to content

Commit

Permalink
Json error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
artem30801 committed Mar 21, 2019
1 parent 4ee4dc4 commit 32c16bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Drone/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def form_message(str_command, dict_arguments):
def parse_message(msg):
try:
j_message = json.loads(msg)
except json.decoder.JSONDecodeError:
except json.JSONDecodeError:
print("Json string not in correct format")
return None
return None, None

str_command = list(j_message.keys())[0]

Expand Down Expand Up @@ -253,13 +253,13 @@ def load_config():
command, args = parse_message(message)
print("Command from server:", command, args)
if command == "writefile":
recive_file(list(args.values)[0])
recive_file(list(args.values)[0]) #TODO repace
elif command == 'config_write':
write_to_config(args['section'], args['option'], args['value'])
elif command == 'config_reload':
load_config()
elif command == "starttime":
starttime = float(list(args.values)[0])
starttime = float(list(args.values)[0]) #TODO repace
print("Starting on:", time.ctime(starttime))
dt = starttime - get_ntp_time(NTP_HOST, NTP_PORT)
print("Until start:", dt)
Expand Down

0 comments on commit 32c16bb

Please sign in to comment.