Skip to content

Commit a9b1c0e

Browse files
authored
Merge pull request #4 from stackhpc/error-handling-on-user-lookup
Add error handling on lookup of user info
2 parents 5c6cf6c + 82508be commit a9b1c0e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

radosgw_usage_exporter.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,11 @@ def _get_user_info(self, user):
462462
)
463463
logging.debug((json.dumps(user_info, indent=4, sort_keys=True)))
464464

465+
if user_info is None:
466+
logging.warning(f"Failed to get info for user: {user}. "
467+
"Metrics for this user will not be added.")
468+
return
469+
465470
if "display_name" in user_info:
466471
user_display_name = user_info["display_name"]
467472
else:

0 commit comments

Comments
 (0)