ucsAccounts: Print user info on error for debugging purposes

This commit is contained in:
Adam Goldsmith 2020-11-11 13:21:08 -05:00
parent 3849aca918
commit 34539eb630

View File

@ -5,7 +5,7 @@ import re
import string import string
from udm_rest_client.udm import UDM 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 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_")] other_old_groups = [g for g in user.props.groups if g[3:].startswith("MW_")]
user.props.groups = other_old_groups + new_groups 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(): def main():