Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Added log to handle errors when creating superuser (#1232)
Browse files Browse the repository at this point in the history
Add log to handle errors from the storehouse in the operation to create superuser.
  • Loading branch information
cmagnobarbosa committed Feb 18, 2021
1 parent f145a7f commit 35e3868
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kytos/core/auth.py
Expand Up @@ -86,7 +86,9 @@ def _generate_token(cls, username, time_exp):
def _create_superuser(self):
"""Create a superuser using Storehouse."""
def _create_superuser_callback(_event, box, error):
if box and not error:
if error:
LOG.error('Superuser was not created. Error: %s', error)
if box:
LOG.info("Superuser successfully created")

def get_username():
Expand Down

0 comments on commit 35e3868

Please sign in to comment.