Skip to content

Commit

Permalink
refactor: use f-strings (grapheneX#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
jxdv authored Dec 31, 2023
1 parent 40cf3be commit bbcd7eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion graphenex/core/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def do_harden(self, arg):
err_msg += " Try running the grapheneX with sudo."
logger.error(err_msg)
except Exception as e:
logger.error("Failed to execute hardening command. " + str(e))
logger.error(f"Failed to execute hardening command: {e}")

def do_EOF(self, arg):
"""EOF exit"""
Expand Down
6 changes: 3 additions & 3 deletions graphenex/core/web/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ def hardening_exec(data):
emit(data + "_log", {"state": "error"})
logger.error(err_msg)
except Exception as e:
fail_msg = "Failed to execute hardening command."
fail_msg = "Failed to execute hardening command"
emit('log_message', {
'tag': 'danger',
'content': fail_msg,
'duration': 2000
})
emit(data + "_log", {"msg": str(e), "state": "error"})
logger.error(fail_msg + " " + str(e))
logger.error(f"{fail_msg}: {e}")


@socketio.on('add_module')
Expand Down Expand Up @@ -220,7 +220,7 @@ def add_module(mod):
# Success event with module count
emit('new_module_added', get_mod_count(module_dict))
except Exception as e:
exception_msg = "Error occurred while adding new module. " + str(e)
exception_msg = f"Error occurred while adding new module: {e}"
emit('log_message', {
'tag': 'warning',
'content': exception_msg,
Expand Down

0 comments on commit bbcd7eb

Please sign in to comment.