Skip to content
Snippets Groups Projects
Commit 38f1df25 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Fix F841 local variable never used

parent 6fb92e8f
No related branches found
No related tags found
No related merge requests found
......@@ -13,9 +13,11 @@ def on_message(ch, method, properties, body):
# Retrieve routing key
routing_key = method.routing_key
print(routing_key)
# Retrieve message
msg = json.loads(body)
print(msg)
# Do Something
print("[{}]: Callback called.".format(task))
......
......@@ -51,7 +51,7 @@ def dir_verify(ch, method, properties, body):
" wrong"
)
except Exception as exception:
except Exception:
msg["success"] = False
msg["errmsg"] = "Exception raised, check the logs for stack trace"
logger.error("", exc_info=True)
......
......@@ -80,7 +80,7 @@ def resolve_uid_gid(ch, method, properties, body):
create_account(msg)
msg["task"] = task
msg["success"] = True
except Exception as exception:
except Exception:
msg["success"] = False
msg["errmsg"] = (
"Exception raised during account creation, check logs for stack"
......
......@@ -111,7 +111,7 @@ def git_commit(ch, method, properties, body):
logger.info("Added ldif files and committed to git repo")
msg["success"] = True
except Exception as exception:
except Exception:
logger.error("", exc_info=True)
# Send confirm message
......
......@@ -87,7 +87,7 @@ def notify_user(ch, method, properties, body):
logger.debug(f"User {username} inserted into database")
msg["success"] = True
except Exception as exception:
except Exception:
logger.error("", exc_info=True)
msg["errmsg"] = errmsg if errmsg else "Unexpected error"
......
......@@ -61,7 +61,7 @@ def mail_list_subscription(ch, method, properties, body):
s.quit()
msg["task"] = task
msg["success"] = True
except Exception as exception:
except Exception:
logger.error("", exc_info=True)
# Acknowledge message
......
......@@ -259,7 +259,7 @@ def task_manager(ch, method, properties, body):
logger.debug(f"Notify level {task_name}? {success}")
except Exception as exception:
except Exception:
logger.error("", exc_info=True)
if send:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment