Bug 854371

Summary: api: Misleading status / returned object when trying to create user with incomplete parameters
Product: Red Hat Enterprise Virtualization Manager Reporter: Oded Ramraz <oramraz>
Component: ovirt-engine-restapiAssignee: Ori Liel <oliel>
Status: CLOSED CURRENTRELEASE QA Contact: Ilia Meerovich <iliam>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: bazulay, cpelland, dyasny, ecohen, iheim, italkohe, lpeer, michal.skrivanek, mkenneth, mpastern, ofrenkel, oliel, oramraz, Rhev-m-bugs, sgrinber, yeylon, ykaul, yzaslavs
Target Milestone: ---Keywords: Reopened, ZStream
Target Release: 3.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: SF3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 877053 (view as bug list) Environment:
Last Closed: 2012-09-05 07:45:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 877053, 915537    

Description Oded Ramraz 2012-09-04 19:19:42 UTC
Description of problem:

Misleading status / returned object when trying to create user with incomplete parameters ( see additional information )

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

[RHEVM shell (connected)]# create user --user_name test

id         : fdfc627c-d875-11e0-90f0-83df133b58cc
name       : admin
domain-id  : 696e7465-726e-616c-696e-7465726e616c
domain-name: internal
user_name  : admin@internal

[RHEVM shell (connected)]# status

last command status: 0 (OK)

Comment 1 Oded Ramraz 2012-09-04 19:24:40 UTC
I see wrong behavior when adding VM with --user-name parameter:
It seems like it search according to last name , and if there are few users with same last name it added the first one: 

[RHEVM shell (connected)]# create user --user_name test --domain-name qa.lab.tlv.redhat.com

id               : 841a2169-d509-4e02-9c42-e3a5b7e86165
name             : Audio01
domain-id        : 71612e6c-6162-2e74-6c76-2e7265646861
domain-name      : qa.lab.tlv.redhat.com
groups-group-name: qa.lab.tlv.redhat.com/QA-All-Users/RDP-Group
groups-group-name: qa.lab.tlv.redhat.com/QA-All-Users/LocalAdmins-Group
last_name        : Test
user_name        : Audio01.com

Comment 2 Michael Pasternak 2012-09-05 07:44:30 UTC
(In reply to comment #1)
> I see wrong behavior when adding VM with --user-name parameter:
> It seems like it search according to last name , and if there are few users
> with same last name it added the first one: 
> 
> [RHEVM shell (connected)]# create user --user_name test --domain-name
> qa.lab.tlv.redhat.com
> 
> id               : 841a2169-d509-4e02-9c42-e3a5b7e86165
> name             : Audio01
> domain-id        : 71612e6c-6162-2e74-6c76-2e7265646861
> domain-name      : qa.lab.tlv.redhat.com
> groups-group-name: qa.lab.tlv.redhat.com/QA-All-Users/RDP-Group
> groups-group-name: qa.lab.tlv.redhat.com/QA-All-Users/LocalAdmins-Group
> last_name        : Test
> user_name        : Audio01.com

no, it's LDAP search by username in AD

Comment 3 Michael Pasternak 2012-09-05 07:45:23 UTC
(In reply to comment #0)
> Description of problem:
> 
> Misleading status / returned object when trying to create user with
> incomplete parameters ( see additional information )
> 
> Version-Release number of selected component (if applicable):
> 
> 
> How reproducible:
> 
> 
> Steps to Reproduce:
> 1.
> 2.
> 3.
>   
> Actual results:
> 
> 
> Expected results:
> 
> 
> Additional info:
> 
> [RHEVM shell (connected)]# create user --user_name test
> 
> id         : fdfc627c-d875-11e0-90f0-83df133b58cc
> name       : admin
> domain-id  : 696e7465-726e-616c-696e-7465726e616c
> domain-name: internal
> user_name  : admin@internal
> 
> [RHEVM shell (connected)]# status
> 
> last command status: 0 (OK)

if BE doesn't fail action, it's succeeded from cli PoV

Comment 4 Oded Ramraz 2012-09-05 07:56:22 UTC
Please fix this behavior:

[RHEVM shell (connected)]# create user --user_name no_such_user 

id         : fdfc627c-d875-11e0-90f0-83df133b58cc
name       : admin
domain-id  : 696e7465-726e-616c-696e-7465726e616c
domain-name: internal
user_name  : admin@internal

The user is not created and I get object with admin@internal instead.

Comment 5 Michael Pasternak 2012-09-05 10:31:11 UTC
so this is api bug and not cli's

Comment 6 Ori Liel 2012-09-06 07:44:06 UTC
Problem in Backend code, any search on 'interna' domain, regardless of the fileter, returns the 'admin' user (note that if domain is not passed in the request, the default domain, which is 'interna', is used).

Comment 7 Barak 2012-09-08 14:57:59 UTC
The create user command did not specify from which domain to extract the user.
Is this a valid behaviour ?

Comment 10 Yair Zaslavsky 2012-09-11 12:12:56 UTC
In reply to comment #4 - 
IMHO this should have been a separate bug.
Comment #1 - Comment #3 dealt with some other issue.

I also think this is a matter of engine bug - internal broker has limited functionality, and IIRC, will return the admin@internal user for each search query.

Comment 11 Michael Pasternak 2012-09-27 12:37:50 UTC
(In reply to comment #7)
> The create user command did not specify from which domain to extract the
> user.
> Is this a valid behaviour ?

not valid indeed, ori please add domain to validate()

Comment 18 Michael Pasternak 2012-10-29 09:52:10 UTC
http://gerrit.ovirt.org/#/c/8329/

Comment 24 Oded Ramraz 2013-02-06 10:06:07 UTC
[RHEVM shell (connected)]# create user --user_name test
*** Unknown syntax: create user --user_name test


Verified sf5

Comment 25 Itamar Heim 2013-06-11 08:57:20 UTC
3.2 has been released

Comment 26 Itamar Heim 2013-06-11 08:57:26 UTC
3.2 has been released

Comment 27 Itamar Heim 2013-06-11 08:57:34 UTC
3.2 has been released

Comment 28 Itamar Heim 2013-06-11 08:59:39 UTC
3.2 has been released

Comment 29 Itamar Heim 2013-06-11 09:29:11 UTC
3.2 has been released