From 34539eb630ce4d76ff208e5dd7ac86596f386bec Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 11 Nov 2020 13:21:08 -0500 Subject: [PATCH] ucsAccounts: Print user info on error for debugging purposes --- memberPlumbing/ucsAccounts.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/memberPlumbing/ucsAccounts.py b/memberPlumbing/ucsAccounts.py index 4f8905a..9d02d97 100755 --- a/memberPlumbing/ucsAccounts.py +++ b/memberPlumbing/ucsAccounts.py @@ -5,7 +5,7 @@ import re import string from udm_rest_client.udm import UDM -from udm_rest_client.exceptions import NoObject +from udm_rest_client.exceptions import NoObject, UdmError from .config import Config @@ -111,7 +111,12 @@ async def _main(): other_old_groups = [g for g in user.props.groups if g[3:].startswith("MW_")] user.props.groups = other_old_groups + new_groups - await user.save() + try: + await user.save() + except UdmError: + print("Failed to save user", username) + print(user.props) + raise def main():