On Mon, 2016-04-18 at 15:53 +0200, Ondra Machacek wrote: > On 04/18/2016 12:37 PM, Karli Sjöberg wrote: > > > > Hi! > > > > A little background: > > https://www.mail-archive.com/[email protected]/msg31815.html > > > > Trying to add new user from webadmin gives: > > 2016-04-18 12:19:14,448 > > INFO [org.ovirt.engine.core.bll.aaa.AddUserCommand] (default task- > > 10) [53227bd6] Running command: AddUserCommand internal: false. > > Entities affected : ID: aaa00000-0000-0000-0000-123456789aaa Type: > > SystemAction group MANIPULATE_USERS with role type ADMIN > > 2016-04-18 12:19:14,466 > > INFO [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLog > > Director] (default task-10) [53227bd6] Correlation ID: 53227bd6, > > Call Stack: null, Custom Event ID: -1, Message: User 'Firstname.Las > > [email protected]' was added successfully to the system. > > > > The user is then found as '[email protected]@baz.foo.bar' > > under Users tab. Also possible to find user with api: > > https://engine-address.foo.bar/ovirt-engine/api/users?search=Firstn > > ame > > ... > > <user_name>[email protected]@baz.foo.bar</user_name> > > ... > > > > But removing the user and trying to add it again with e.g. Python > > fails: > > > > status: 404 > > reason: Not Found > > detail: Entity not found: [email protected]:: username=Firstname.L > > [email protected] > > > > The code, previously working with the now deprecated engine-manage- > > domains, except PRINCIPAL_NAME was just SAM_ACCOUNT_NAME without > > SUFFIX: > > > > DOMAIN_NAME = 'baz.foo.bar' > > SUFFIX = '@foo.bar' > > > > try: > > domain = api.domains.get(name='%s' % (DOMAIN_NAME)) > > userparams = params.User() > > userparams.set_user_name('%s%s' % (PRINCIPAL_NAME,SUFFIX)) > > userparams.set_domain(domain) > Please set ^ here also: > > userparams.set_principal('%s%s' % (PRINCIPAL_NAME,SUFFIX)) > > in principal you should set proper UPN of user.
Yeah, that was the ticket. Thanks! /K > > > > > api.users.add(userparams) > > except Exception as e: > > print e > > > > Also tried with SUFFIX = '@[email protected]', as that´s what the > > user is called after creation, fails as well. > > > > Am I "holding it wrong" or is this a bug? > > > > /K > > _______________________________________________ > > Users mailing list > > [email protected] > > http://lists.ovirt.org/mailman/listinfo/users > > _______________________________________________ Users mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/users

