Bug 1155466

Summary: operation failed, when adding admin@internal via REST
Product: Red Hat Enterprise Virtualization Manager Reporter: Ondra Machacek <omachace>
Component: ovirt-engineAssignee: Yair Zaslavsky <yzaslavs>
Status: CLOSED UPSTREAM QA Contact: Ondra Machacek <omachace>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: alonbl, ecohen, gklein, iheim, lpeer, lsurette, omachace, oourfali, rbalakri, Rhev-m-bugs, yeylon
Target Milestone: ---   
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-08 15:33:29 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: 1076964    

Description Ondra Machacek 2014-10-22 07:59:44 UTC
Description of problem:


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

How reproducible:
always

Steps to Reproduce:
curl -k -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -H "Filter: $filter" -d "<user><domain><name>internal</name></domain><user_name>admin</user_name></user>" -u $U $URL/users


Actual results:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <reason>Operation Failed</reason>
    <detail>[]</detail>
</fault>


Expected results:
no error. info that user already is in system.

Additional info:

Comment 1 Oved Ourfali 2014-10-23 05:59:52 UTC
> 
> Expected results:
> no error. info that user already is in system.

There should be an error, but specifying that the user already exists in the system.

Comment 2 Alon Bar-Lev 2014-12-30 09:59:21 UTC
Works for me at least in master, can you please check upstream 3.5 branch?

$ curl http://admin%40internal:engine@localhost:8080/ovirt-engine/api/users -H "Content-Type: application/xml" -X POST -d "<user><domain><name>internal</name></domain><user_name>admin</user_name></user>"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user href="/ovirt-engine/api/users/fdfc627c-d875-11e0-90f0-83df133b58cc" id="fdfc627c-d875-11e0-90f0-83df133b58cc">
    <name>admin</name>
    <link href="/ovirt-engine/api/users/fdfc627c-d875-11e0-90f0-83df133b58cc/permissions" rel="permissions"/>
    <link href="/ovirt-engine/api/users/fdfc627c-d875-11e0-90f0-83df133b58cc/roles" rel="roles"/>
    <link href="/ovirt-engine/api/users/fdfc627c-d875-11e0-90f0-83df133b58cc/tags" rel="tags"/>
    <domain href="/ovirt-engine/api/domains/696E7465726E616C" id="696E7465726E616C">
        <name>internal</name>
    </domain>
    <domain_entry_id>66646663363237632D643837352D313165302D393066302D383364663133336235386363</domain_entry_id>
    <namespace>*</namespace>
    <user_name>admin@internal</user_name>
    <principal>admin</principal>
</user>

Comment 3 Ondra Machacek 2015-01-08 07:26:40 UTC
I can see the same as you, but it display result same as when user is created.
Should be displayed error with message, that user already exists?

Comment 4 Alon Bar-Lev 2015-01-08 07:56:47 UTC
no, by "design" for some reason, add user of existing user is allowed, and it cause refresh of that user, now that there is no sync, this operation is simply void. as long as you see the same id for user it is ok.