Bug 854371 - api: Misleading status / returned object when trying to create user with incomplete parameters
api: Misleading status / returned object when trying to create user with inco...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi (Show other bugs)
3.1.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 3.2.0
Assigned To: Ori Liel
Ilia Meerovich
infra
: Reopened, ZStream
Depends On:
Blocks: 877053 915537
  Show dependency treegraph
 
Reported: 2012-09-04 15:19 EDT by Oded Ramraz
Modified: 2016-02-10 14:32 EST (History)
17 users (show)

See Also:
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 03:45:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Oded Ramraz 2012-09-04 15:19:42 EDT
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 15:24:40 EDT
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@qa.qumranet.com
Comment 2 Michael Pasternak 2012-09-05 03:44:30 EDT
(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@qa.qumranet.com

no, it's LDAP search by username in AD
Comment 3 Michael Pasternak 2012-09-05 03:45:23 EDT
(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 03:56:22 EDT
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 06:31:11 EDT
so this is api bug and not cli's
Comment 6 Ori Liel 2012-09-06 03:44:06 EDT
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 10:57:59 EDT
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 08:12:56 EDT
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 08:37:50 EDT
(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 05:52:10 EDT
http://gerrit.ovirt.org/#/c/8329/
Comment 24 Oded Ramraz 2013-02-06 05:06:07 EST
[RHEVM shell (connected)]# create user --user_name test
*** Unknown syntax: create user --user_name test


Verified sf5
Comment 25 Itamar Heim 2013-06-11 04:57:20 EDT
3.2 has been released
Comment 26 Itamar Heim 2013-06-11 04:57:26 EDT
3.2 has been released
Comment 27 Itamar Heim 2013-06-11 04:57:34 EDT
3.2 has been released
Comment 28 Itamar Heim 2013-06-11 04:59:39 EDT
3.2 has been released
Comment 29 Itamar Heim 2013-06-11 05:29:11 EDT
3.2 has been released

Note You need to log in before you can comment on or make changes to this bug.