about summary refs log tree commit diff
path: root/gn3/api/async_commands.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-03-11 11:51:02 +0300
committerFrederick Muriuki Muriithi2022-03-11 11:51:02 +0300
commit9691e225724e041997c74f8665dcbfa12bb1c579 (patch)
tree271d99dbf6d72161e343ddf8765f9543fe752e37 /gn3/api/async_commands.py
parenta7696cc668e00215e1d5af2425765451811bca9d (diff)
downloadgenenetwork3-9691e225724e041997c74f8665dcbfa12bb1c579.tar.gz
Fix some linting issues
Diffstat (limited to 'gn3/api/async_commands.py')
-rw-r--r--gn3/api/async_commands.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/gn3/api/async_commands.py b/gn3/api/async_commands.py
index 81c3c44..c0cf4bb 100644
--- a/gn3/api/async_commands.py
+++ b/gn3/api/async_commands.py
@@ -1,6 +1,4 @@
 """Endpoints and functions concerning commands run in external processes."""
-import json
-
 import redis
 from flask import jsonify, Blueprint
 
@@ -8,11 +6,11 @@ async_commands = Blueprint("async_commands", __name__)
 
 @async_commands.route("/state/<command_id>")
 def command_state(command_id):
+    """Respond with the current state of command identified by `command_id`."""
     with redis.Redis(decode_responses=True) as rconn:
         state = rconn.hgetall(name=command_id)
         if not state:
             return jsonify(
                 status=404,
                 error="The command id provided does not exist.")
-        state = {key: val for key,val in state.items()}
-        return jsonify(state)
+        return jsonify(dict(state.items()))